Lines 15-21
Link Here
|
15 |
import org.eclipse.jdt.core.compiler.CharOperation; |
15 |
import org.eclipse.jdt.core.compiler.CharOperation; |
16 |
import org.eclipse.jdt.internal.compiler.ast.TypeReference; |
16 |
import org.eclipse.jdt.internal.compiler.ast.TypeReference; |
17 |
import org.eclipse.jdt.internal.compiler.ast.Wildcard; |
17 |
import org.eclipse.jdt.internal.compiler.ast.Wildcard; |
18 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
|
|
19 |
|
18 |
|
20 |
/** |
19 |
/** |
21 |
* A parameterized type encapsulates a type with type arguments, |
20 |
* A parameterized type encapsulates a type with type arguments, |
Lines 858-876
Link Here
|
858 |
this.arguments[i] = resolveType; |
857 |
this.arguments[i] = resolveType; |
859 |
this.tagBits |= resolvedType.tagBits & TagBits.ContainsNestedTypeReferences; |
858 |
this.tagBits |= resolvedType.tagBits & TagBits.ContainsNestedTypeReferences; |
860 |
} |
859 |
} |
861 |
// arity check |
860 |
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565, Removed generic check |
862 |
TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables(); |
861 |
and arity check since we are dealing with binary types here and the fact that |
863 |
if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic |
862 |
the compiler produced class files for these types at all is proof positive that |
864 |
// Below 1.5, we should have already complained about the use of type parameters. |
863 |
the generic check and the arity check passed in the build environment that produced |
865 |
boolean isCompliant15 = this.environment.globalOptions.originalSourceLevel >= ClassFileConstants.JDK1_5; |
864 |
these class files. Otherwise we don't handle mixed 1.5 and 1.4 projects correctly. |
866 |
if (isCompliant15 && (resolvedType.tagBits & TagBits.HasMissingType) == 0) { |
865 |
Just as with bounds check below, incremental build will propagate the change and |
867 |
this.environment.problemReporter.nonGenericTypeCannotBeParameterized(0, null, resolvedType, this.arguments); |
866 |
detect problems in source. |
868 |
} |
867 |
*/ |
869 |
return this; |
868 |
|
870 |
} else if (argLength != refTypeVariables.length) { // check arity |
869 |
// // arity check |
871 |
this.environment.problemReporter.incorrectArityForParameterizedType(null, resolvedType, this.arguments); |
870 |
// TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables(); |
872 |
return this; // cannot reach here as AbortCompilation is thrown |
871 |
// if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic |
873 |
} |
872 |
// // Below 1.5, we should have already complained about the use of type parameters. |
|
|
873 |
// boolean isCompliant15 = this.environment.globalOptions.originalSourceLevel >= ClassFileConstants.JDK1_5; |
874 |
// if (isCompliant15 && (resolvedType.tagBits & TagBits.HasMissingType) == 0) { |
875 |
// this.environment.problemReporter.nonGenericTypeCannotBeParameterized(0, null, resolvedType, this.arguments); |
876 |
// } |
877 |
// return this; |
878 |
// } else if (argLength != refTypeVariables.length) { // check arity |
879 |
// this.environment.problemReporter.incorrectArityForParameterizedType(null, resolvedType, this.arguments); |
880 |
// return this; // cannot reach here as AbortCompilation is thrown |
881 |
// } |
874 |
// check argument type compatibility... REMOVED for now since incremental build will propagate change & detect in source |
882 |
// check argument type compatibility... REMOVED for now since incremental build will propagate change & detect in source |
875 |
// for (int i = 0; i < argLength; i++) { |
883 |
// for (int i = 0; i < argLength; i++) { |
876 |
// TypeBinding resolvedArgument = this.arguments[i]; |
884 |
// TypeBinding resolvedArgument = this.arguments[i]; |