View | Details | Raw Unified | Return to bug 100584 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java (-1 / +27 lines)
Lines 39-45 Link Here
39
	}
39
	}
40
40
41
	static {
41
	static {
42
//		TESTS_NUMBERS = new int[] { 191 };
42
		TESTS_NUMBERS = new int[] { 192 };
43
//		TESTS_NAMES = new String[] {"test0189"};
43
//		TESTS_NAMES = new String[] {"test0189"};
44
	}
44
	}
45
	public static Test suite() {
45
	public static Test suite() {
Lines 5747-5750 Link Here
5747
		assertNotNull("No binding", typeBinding2);
5747
		assertNotNull("No binding", typeBinding2);
5748
		assertTrue("Not cast compatible", typeBinding2.isCastCompatible(typeBinding));
5748
		assertTrue("Not cast compatible", typeBinding2.isCastCompatible(typeBinding));
5749
	}
5749
	}
5750
5751
	// Wrong ParameterizedTypeBinding yields null type declaration result
5752
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100584
5753
	public void test0192() throws JavaModelException {
5754
    	this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
5755
    	String contents =
5756
			"public class X<E> {\n" + 
5757
			"	public static class InnerClass {\n" + 
5758
			"		static class InnerInnerClass {\n" + 
5759
			"			/*start*/X.WrongInnerClass/*end*/.InnerInnerClass m;\n" + 
5760
			"		}\n" + 
5761
			"	}\n" + 
5762
			"}";
5763
	   	IBinding[] bindings = resolveBindings(contents, this.workingCopy);
5764
	   	if (bindings[0] != null) {
5765
	   		// should not get here if patch 100584 applied
5766
		   	try {
5767
		   		bindings[0].toString();
5768
		   		fail("should get an exception if bug 100584 present");
5769
		   		// which means that the code would now return a non null, 
5770
		   		// erroneous binding, yet able to respond to toString
5771
		   	} catch (Throwable t) {/* absorb quietly */}
5772
	   	}
5773
	   	assertTrue("should yield a null, not a malformed binding", 
5774
	   			bindings[0] == null);
5775
	}
5750
}
5776
}
(-)src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java (+3 lines)
Lines 38-43 Link Here
38
import org.eclipse.jdt.core.dom.MethodInvocation;
38
import org.eclipse.jdt.core.dom.MethodInvocation;
39
import org.eclipse.jdt.core.dom.PackageDeclaration;
39
import org.eclipse.jdt.core.dom.PackageDeclaration;
40
import org.eclipse.jdt.core.dom.ParameterizedType;
40
import org.eclipse.jdt.core.dom.ParameterizedType;
41
import org.eclipse.jdt.core.dom.QualifiedName;
41
import org.eclipse.jdt.core.dom.SimpleName;
42
import org.eclipse.jdt.core.dom.SimpleName;
42
import org.eclipse.jdt.core.dom.SimpleType;
43
import org.eclipse.jdt.core.dom.SimpleType;
43
import org.eclipse.jdt.core.dom.TypeDeclaration;
44
import org.eclipse.jdt.core.dom.TypeDeclaration;
Lines 411-416 Link Here
411
				return ((Assignment) node).getRightHandSide().resolveTypeBinding();
412
				return ((Assignment) node).getRightHandSide().resolveTypeBinding();
412
			case ASTNode.SIMPLE_TYPE:
413
			case ASTNode.SIMPLE_TYPE:
413
				return ((SimpleType) node).resolveBinding();
414
				return ((SimpleType) node).resolveBinding();
415
			case ASTNode.QUALIFIED_NAME:
416
				return ((QualifiedName) node).resolveBinding();
414
			default:
417
			default:
415
				throw new Error("Not yet implemented for this type of node: " + node);
418
				throw new Error("Not yet implemented for this type of node: " + node);
416
		}
419
		}

Return to bug 100584