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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 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 612-618 Link Here
612
		            		ReferenceBinding otherEnclosing = otherParamType.enclosingType();
612
		            		ReferenceBinding otherEnclosing = otherParamType.enclosingType();
613
		            		if (otherEnclosing == null) return true;
613
		            		if (otherEnclosing == null) return true;
614
		            		if ((otherEnclosing.tagBits & TagBits.HasDirectWildcard) == 0) {
614
		            		if ((otherEnclosing.tagBits & TagBits.HasDirectWildcard) == 0) {
615
								if (enclosing != otherEnclosing) return true;
615
		            			if (enclosing.isProvablyDistinct(otherEnclosing)) return true; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=302919
616
		            		} else {
616
		            		} else {
617
		            			if (!enclosing.isEquivalentTo(otherParamType.enclosingType())) return true;
617
		            			if (!enclosing.isEquivalentTo(otherParamType.enclosingType())) return true;
618
		            		}
618
		            		}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java (+29 lines)
Lines 1782-1787 Link Here
1782
		"----------\n"
1782
		"----------\n"
1783
	);
1783
	);
1784
}
1784
}
1785
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302919
1786
public void test048() {
1787
	CompilerOptions options = new CompilerOptions(getCompilerOptions());
1788
	if (options.sourceLevel < ClassFileConstants.JDK1_5) return;
1789
	this.runNegativeTest(
1790
		new String[] {
1791
			"A.java",
1792
			"public class A<T> extends D<T> {\n" +
1793
			"    public class A1 extends D1 {\n" +
1794
			"    }\n" +
1795
			"    void m1(A<T> tree) {\n" +
1796
			"        A.A1 v = ((A.A1) tree.root);\n" +
1797
			"    }\n" +
1798
			"    Zork z;\n" +
1799
			"}\n" +
1800
			"class D<T> {\n" +
1801
			"    protected D1 root;\n" +
1802
			"    protected class D1 {\n" +
1803
			"    }\n" +
1804
			"}\n"
1805
		},
1806
		"----------\n" + 
1807
		"1. ERROR in A.java (at line 7)\n" + 
1808
		"	Zork z;\n" + 
1809
		"	^^^^\n" + 
1810
		"Zork cannot be resolved to a type\n" + 
1811
		"----------\n"
1812
	);
1813
}
1785
public static Class testClass() {
1814
public static Class testClass() {
1786
	return CastTest.class;
1815
	return CastTest.class;
1787
}
1816
}

Return to bug 302919