### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java,v retrieving revision 1.13 diff -u -r1.13 RecoveredTypeBinding.java --- dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java 7 Mar 2009 00:59:01 -0000 1.13 +++ dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java 7 Jan 2011 15:08:33 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -555,8 +555,8 @@ if (packageBinding != null) { final IJavaElement javaElement = packageBinding.getJavaElement(); if (javaElement != null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) { - // best effort: we don't know if the recovered binding is a binary or source binding, so go with a compilation unit - return ((PackageFragment) javaElement).getCompilationUnit(getInternalName() + SuffixConstants.SUFFIX_STRING_java); + // best effort: we don't know if the recovered binding is a binary or source binding, so go with a simple source type + return ((PackageFragment) javaElement).getCompilationUnit(getInternalName() + SuffixConstants.SUFFIX_STRING_java).getType(this.getName()); } } return null; Index: dom/org/eclipse/jdt/core/dom/TypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java,v retrieving revision 1.149 diff -u -r1.149 TypeBinding.java --- dom/org/eclipse/jdt/core/dom/TypeBinding.java 12 Apr 2010 18:24:55 -0000 1.149 +++ dom/org/eclipse/jdt/core/dom/TypeBinding.java 7 Jan 2011 15:08:33 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -506,8 +506,8 @@ if (packageBinding != null) { final IJavaElement javaElement = packageBinding.getJavaElement(); if (javaElement != null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) { - // best effort: we don't know if the recovered binding is a binary or source binding, so go with a compilation unit - return ((PackageFragment) javaElement).getCompilationUnit(new String(this.binding.sourceName()) + SuffixConstants.SUFFIX_STRING_java); + // best effort: we don't know if the recovered binding is a binary or source binding, so go with a simple source type + return ((PackageFragment) javaElement).getCompilationUnit(new String(this.binding.sourceName()) + SuffixConstants.SUFFIX_STRING_java).getType(this.getName()); } } return null; #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v retrieving revision 1.300 diff -u -r1.300 ASTConverter15Test.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 6 Jan 2011 19:58:34 -0000 1.300 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 7 Jan 2011 15:08:34 -0000 @@ -9669,7 +9669,7 @@ assertTrue("Not a recovered binding", binding3.isRecovered()); final IJavaElement javaElement = binding3.getJavaElement(); assertNotNull("No java element", javaElement); - assertEquals("Not a compilation unit", IJavaElement.COMPILATION_UNIT, javaElement.getElementType()); + assertEquals("Not a compilation unit", IJavaElement.TYPE, javaElement.getElementType()); assertNotNull("No parent", javaElement.getParent()); } Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v retrieving revision 1.178 diff -u -r1.178 ASTConverterTestAST3_2.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 13 Dec 2010 14:44:21 -0000 1.178 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 7 Jan 2011 15:08:34 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -9161,6 +9161,7 @@ assertTrue("Not a recovered binding", typeBinding.isRecovered()); IJavaElement javaElement = typeBinding.getJavaElement(); assertNotNull("No java element", javaElement); + assertEquals("Wrong java element type", IJavaElement.TYPE, javaElement.getElementType()); assertTrue("Javalement exists", !javaElement.exists()); IPackageBinding packageBinding = typeBinding.getPackage(); assertNotNull("No package", packageBinding); @@ -9293,6 +9294,7 @@ assertTrue("Not a recovered binding", typeBinding.isRecovered()); IJavaElement javaElement = typeBinding.getJavaElement(); assertNotNull("No java element", javaElement); + assertEquals("Wrong java element type", IJavaElement.TYPE, javaElement.getElementType()); assertTrue("Java element exists", !javaElement.exists()); IPackageBinding packageBinding = typeBinding.getPackage(); assertNotNull("No package", packageBinding);