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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java (+11 lines)
Lines 694-699 Link Here
694
		    return true;
694
		    return true;
695
	    if (otherType == null)
695
	    if (otherType == null)
696
	        return false;
696
	        return false;
697
	    
698
	    /* With the hybrid 1.4/1.5+ projects modes, while establishing type equivalence, we need to
699
	       be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding 
700
	       e.g Map<String, String>, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding 
701
	       When the usage of a type lacks type parameters, whether we land up with the raw form or not depends
702
	       on whether the underlying type was "seen to be" a generic type in the particular build environment or
703
	       not. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827, 
704
	     */
705
	    if (erasure() == otherType.erasure())
706
	    	return true;
707
	    
697
	    switch(otherType.kind()) {
708
	    switch(otherType.kind()) {
698
709
699
	    	case Binding.WILDCARD_TYPE :
710
	    	case Binding.WILDCARD_TYPE :
(-)src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (+49 lines)
Lines 11133-11136 Link Here
11133
			""
11133
			""
11134
	);
11134
	);
11135
}
11135
}
11136
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827 
11137
public void test328827() {
11138
	Map compilerOptions15 = getCompilerOptions();
11139
	compilerOptions15.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
11140
	compilerOptions15.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
11141
	compilerOptions15.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
11142
	this.runConformTest(
11143
		new String[] {
11144
			"Map.java",
11145
			"public interface Map<K,V> {}\n",
11146
			
11147
			"EventProperties.java",
11148
			"public class EventProperties implements Map<String, Object> {}\n",
11149
			
11150
			"Event.java",
11151
			"public class Event {\n" +
11152
			"    public Event(Map<String, ?> properties) {}\n" +
11153
			"}"
11154
		},
11155
		"",
11156
		null,
11157
		true,
11158
		null,
11159
		compilerOptions15,
11160
		null);
11161
	
11162
	Map compilerOptions14 = getCompilerOptions();
11163
	compilerOptions14.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_2);
11164
	compilerOptions14.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4);
11165
	compilerOptions14.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3);
11166
	this.runConformTest(
11167
		new String[] {
11168
				"Map.java",
11169
				"public interface Map {}\n",
11170
				
11171
				"X.java",
11172
				"public class X {\n" +
11173
				"    public void start() {\n" +
11174
				"        Event event = new Event(new EventProperties());\n" + 
11175
				"	}\n" +
11176
				"}"
11177
		},
11178
		"",
11179
		null,
11180
		false,
11181
		null,
11182
		compilerOptions14,
11183
		null);
11184
}
11136
}
11185
}

Return to bug 328827