### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java,v retrieving revision 1.115 diff -u -r1.115 ParameterizedTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 20 Oct 2010 05:46:47 -0000 1.115 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 28 Oct 2010 11:37:32 -0000 @@ -731,7 +731,17 @@ case Binding.RAW_TYPE : return erasure() == otherType.erasure(); } - return false; + /* With the hybrid 1.4/1.5+ projects modes, while establishing type equivalence, we need to + be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding + e.g Map, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding + When the usage of a type lacks type parameters, whether we land up with the raw form or not depends + on whether the underlying type was "seen to be" a generic type in the particular build environment or + not. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827 + */ + if (this.environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 && erasure() == otherType) { + return true; + } + return false; } public boolean isHierarchyConnected() { #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java,v retrieving revision 1.204 diff -u -r1.204 MethodVerifyTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 22 Oct 2010 04:25:43 -0000 1.204 +++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 28 Oct 2010 11:38:11 -0000 @@ -11133,4 +11133,53 @@ "" ); } +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827 +public void test328827() { + Map compilerOptions15 = getCompilerOptions(); + compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5); + compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); + compilerOptions15.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); + this.runConformTest( + new String[] { + "Map.java", + "public interface Map {}\n", + + "EventProperties.java", + "public class EventProperties implements Map {}\n", + + "Event.java", + "public class Event {\n" + + " public Event(Map properties) {}\n" + + "}" + }, + "", + null, + true, + null, + compilerOptions15, + null); + + Map compilerOptions14 = getCompilerOptions(); + compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2); + compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); + compilerOptions14.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); + this.runConformTest( + new String[] { + "Map.java", + "public interface Map {}\n", + + "X.java", + "public class X {\n" + + " public void start() {\n" + + " Event event = new Event(new EventProperties());\n" + + " }\n" + + "}" + }, + "", + null, + false, + null, + compilerOptions14, + null); +} }