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 868-886
Link Here
|
868 |
this.arguments[i] = resolveType; |
867 |
this.arguments[i] = resolveType; |
869 |
this.tagBits |= resolvedType.tagBits & TagBits.ContainsNestedTypeReferences; |
868 |
this.tagBits |= resolvedType.tagBits & TagBits.ContainsNestedTypeReferences; |
870 |
} |
869 |
} |
871 |
// arity check |
870 |
/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=186565, Removed generic check |
872 |
TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables(); |
871 |
and arity check since we are dealing with binary types here and the fact that |
873 |
if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic |
872 |
the compiler produced class files for these types at all is proof positive that |
874 |
// Below 1.5, we should have already complained about the use of type parameters. |
873 |
the generic check and the arity check passed in the build environment that produced |
875 |
boolean isCompliant15 = this.environment.globalOptions.originalSourceLevel >= ClassFileConstants.JDK1_5; |
874 |
these class files. Otherwise we don't handle mixed 1.5 and 1.4 projects correctly. |
876 |
if (isCompliant15 && (resolvedType.tagBits & TagBits.HasMissingType) == 0) { |
875 |
Just as with bounds check below, incremental build will propagate the change and |
877 |
this.environment.problemReporter.nonGenericTypeCannotBeParameterized(0, null, resolvedType, this.arguments); |
876 |
detect problems in source. |
878 |
} |
877 |
*/ |
879 |
return this; |
878 |
|
880 |
} else if (argLength != refTypeVariables.length) { // check arity |
879 |
// // arity check |
881 |
this.environment.problemReporter.incorrectArityForParameterizedType(null, resolvedType, this.arguments); |
880 |
// TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables(); |
882 |
return this; // cannot reach here as AbortCompilation is thrown |
881 |
// if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic |
883 |
} |
882 |
// // Below 1.5, we should have already complained about the use of type parameters. |
|
|
883 |
// boolean isCompliant15 = this.environment.globalOptions.originalSourceLevel >= ClassFileConstants.JDK1_5; |
884 |
// if (isCompliant15 && (resolvedType.tagBits & TagBits.HasMissingType) == 0) { |
885 |
// this.environment.problemReporter.nonGenericTypeCannotBeParameterized(0, null, resolvedType, this.arguments); |
886 |
// } |
887 |
// return this; |
888 |
// } else if (argLength != refTypeVariables.length) { // check arity |
889 |
// this.environment.problemReporter.incorrectArityForParameterizedType(null, resolvedType, this.arguments); |
890 |
// return this; // cannot reach here as AbortCompilation is thrown |
891 |
// } |
884 |
// check argument type compatibility... REMOVED for now since incremental build will propagate change & detect in source |
892 |
// check argument type compatibility... REMOVED for now since incremental build will propagate change & detect in source |
885 |
// for (int i = 0; i < argLength; i++) { |
893 |
// for (int i = 0; i < argLength; i++) { |
886 |
// TypeBinding resolvedArgument = this.arguments[i]; |
894 |
// TypeBinding resolvedArgument = this.arguments[i]; |