View | Details | Raw Unified | Return to bug 333710
Collapse All | Expand All

(-)dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
2
 * Copyright (c) 2007, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 555-562 Link Here
555
		if (packageBinding != null) {
555
		if (packageBinding != null) {
556
			final IJavaElement javaElement = packageBinding.getJavaElement();
556
			final IJavaElement javaElement = packageBinding.getJavaElement();
557
			if (javaElement != null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
557
			if (javaElement != null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
558
				// best effort: we don't know if the recovered binding is a binary or source binding, so go with a compilation unit
558
				// best effort: we don't know if the recovered binding is a binary or source binding, so go with a simple source type
559
				return ((PackageFragment) javaElement).getCompilationUnit(getInternalName() + SuffixConstants.SUFFIX_STRING_java);
559
				return ((PackageFragment) javaElement).getCompilationUnit(getInternalName() + SuffixConstants.SUFFIX_STRING_java).getType(this.getName());
560
			}
560
			}
561
		}
561
		}
562
		return null;
562
		return null;
(-)dom/org/eclipse/jdt/core/dom/TypeBinding.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 506-513 Link Here
506
			if (packageBinding != null) {
506
			if (packageBinding != null) {
507
				final IJavaElement javaElement = packageBinding.getJavaElement();
507
				final IJavaElement javaElement = packageBinding.getJavaElement();
508
				if (javaElement != null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
508
				if (javaElement != null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
509
					// best effort: we don't know if the recovered binding is a binary or source binding, so go with a compilation unit
509
					// best effort: we don't know if the recovered binding is a binary or source binding, so go with a simple source type
510
					return ((PackageFragment) javaElement).getCompilationUnit(new String(this.binding.sourceName()) + SuffixConstants.SUFFIX_STRING_java);
510
					return ((PackageFragment) javaElement).getCompilationUnit(new String(this.binding.sourceName()) + SuffixConstants.SUFFIX_STRING_java).getType(this.getName());
511
				}
511
				}
512
			}
512
			}
513
			return null;
513
			return null;
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java (-1 / +1 lines)
Lines 9669-9675 Link Here
9669
		assertTrue("Not a recovered binding", binding3.isRecovered());
9669
		assertTrue("Not a recovered binding", binding3.isRecovered());
9670
		final IJavaElement javaElement = binding3.getJavaElement();
9670
		final IJavaElement javaElement = binding3.getJavaElement();
9671
		assertNotNull("No java element", javaElement);
9671
		assertNotNull("No java element", javaElement);
9672
		assertEquals("Not a compilation unit", IJavaElement.COMPILATION_UNIT, javaElement.getElementType());
9672
		assertEquals("Not a compilation unit", IJavaElement.TYPE, javaElement.getElementType());
9673
		assertNotNull("No parent", javaElement.getParent());
9673
		assertNotNull("No parent", javaElement.getParent());
9674
	}
9674
	}
9675
9675
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 9161-9166 Link Here
9161
			assertTrue("Not a recovered binding", typeBinding.isRecovered());
9161
			assertTrue("Not a recovered binding", typeBinding.isRecovered());
9162
			IJavaElement javaElement = typeBinding.getJavaElement();
9162
			IJavaElement javaElement = typeBinding.getJavaElement();
9163
			assertNotNull("No java element", javaElement);
9163
			assertNotNull("No java element", javaElement);
9164
			assertEquals("Wrong java element type", IJavaElement.TYPE, javaElement.getElementType());
9164
			assertTrue("Javalement exists", !javaElement.exists());
9165
			assertTrue("Javalement exists", !javaElement.exists());
9165
			IPackageBinding packageBinding = typeBinding.getPackage();
9166
			IPackageBinding packageBinding = typeBinding.getPackage();
9166
			assertNotNull("No package", packageBinding);
9167
			assertNotNull("No package", packageBinding);
Lines 9293-9298 Link Here
9293
		assertTrue("Not a recovered binding", typeBinding.isRecovered());
9294
		assertTrue("Not a recovered binding", typeBinding.isRecovered());
9294
		IJavaElement javaElement = typeBinding.getJavaElement();
9295
		IJavaElement javaElement = typeBinding.getJavaElement();
9295
		assertNotNull("No java element", javaElement);
9296
		assertNotNull("No java element", javaElement);
9297
		assertEquals("Wrong java element type", IJavaElement.TYPE, javaElement.getElementType());
9296
		assertTrue("Java element exists", !javaElement.exists());
9298
		assertTrue("Java element exists", !javaElement.exists());
9297
		IPackageBinding packageBinding = typeBinding.getPackage();
9299
		IPackageBinding packageBinding = typeBinding.getPackage();
9298
		assertNotNull("No package", packageBinding);
9300
		assertNotNull("No package", packageBinding);

Return to bug 333710