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 (-1 / +8 lines)
Lines 731-737 Link Here
731
	    	case Binding.RAW_TYPE :
731
	    	case Binding.RAW_TYPE :
732
	            return erasure() == otherType.erasure();
732
	            return erasure() == otherType.erasure();
733
	    }
733
	    }
734
        return false;
734
	    /* With the hybrid 1.4/1.5+ projects modes, while establishing type equivalence, we need to
735
	       be prepared for a type such as Map appearing in one of three forms: As (a) a ParameterizedTypeBinding 
736
	       e.g Map<String, String>, (b) as RawTypeBinding Map#RAW and finally (c) as a BinaryTypeBinding 
737
	       When the usage of a type lacks type parameters, whether we land up with the raw form or not depends
738
	       on whether the underlying type was "seen to be" a generic type in the particular build environment or
739
	       not. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=328827, 
740
	     */
741
	    return erasure() == otherType.erasure();
735
	}
742
	}
736
743
737
	public boolean isHierarchyConnected() {
744
	public boolean isHierarchyConnected() {
(-)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