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

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java (+4 lines)
Lines 307-312 Link Here
307
			char[][] className = CharOperation.deepCopy(enclosingType.compoundName);
307
			char[][] className = CharOperation.deepCopy(enclosingType.compoundName);
308
			className[className.length - 1] =
308
			className[className.length - 1] =
309
				CharOperation.concat(className[className.length - 1], referenceContext.name, '$');
309
				CharOperation.concat(className[className.length - 1], referenceContext.name, '$');
310
			ReferenceBinding existingType = packageBinding.getType0(className[className.length - 1]);
311
			if (existingType != null)
312
				// report the error against the parent - its still safe to answer the member type
313
				this.parent.problemReporter().duplicateNestedType(referenceContext);
310
			referenceContext.binding = new MemberTypeBinding(className, this, enclosingType);
314
			referenceContext.binding = new MemberTypeBinding(className, this, enclosingType);
311
		}
315
		}
312
316
(-)src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java (+19 lines)
Lines 66-69 Link Here
66
		"foo.bar cannot be resolved to a type\n" + 
66
		"foo.bar cannot be resolved to a type\n" + 
67
		"----------\n");
67
		"----------\n");
68
}
68
}
69
// http://bugs.eclipse.org/bugs/show_bug.cgi?id=84886
70
public void test003() {
71
	this.runNegativeTest(
72
		new String[] {
73
			"X.java",
74
			"class X {\n" + 
75
			"	class MyFoo {\n" + 
76
			"		class Bar {}\n" + 
77
			"	}\n" + 
78
			"	static class MyFoo$Bar {}\n" + 
79
			"}\n",
80
		},
81
		"----------\n" + 
82
		"1. ERROR in X.java (at line 5)\n" + 
83
		"	static class MyFoo$Bar {}\n" + 
84
		"	             ^^^^^^^^^\n" + 
85
		"Duplicate nested type MyFoo$Bar\n" + 
86
		"----------\n");
87
}
69
}
88
}

Return to bug 84886