Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 339478 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/core/compiler/IProblem.java (+2 lines)
Lines 1379-1384 Link Here
1379
	int PolymorphicMethodNotBelow17 = MethodRelated + 876;
1379
	int PolymorphicMethodNotBelow17 = MethodRelated + 876;
1380
	/** @since 3.7 */
1380
	/** @since 3.7 */
1381
	int IncorrectSwitchType17 = TypeRelated + 877;
1381
	int IncorrectSwitchType17 = TypeRelated + 877;
1382
	/** @since 3.7 */
1383
	int CannotInferElidedTypes = TypeRelated + 878;
1382
1384
1383
	/**
1385
	/**
1384
	 * External problems -- These are problems defined by other plugins
1386
	 * External problems -- These are problems defined by other plugins
(-)compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java (+38 lines)
Lines 17-22 Link Here
17
 *******************************************************************************/
17
 *******************************************************************************/
18
package org.eclipse.jdt.internal.compiler.ast;
18
package org.eclipse.jdt.internal.compiler.ast;
19
19
20
import org.eclipse.jdt.core.compiler.CharOperation;
20
import org.eclipse.jdt.internal.compiler.ASTVisitor;
21
import org.eclipse.jdt.internal.compiler.ASTVisitor;
21
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
22
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
22
import org.eclipse.jdt.internal.compiler.codegen.*;
23
import org.eclipse.jdt.internal.compiler.codegen.*;
Lines 33-38 Link Here
33
	public TypeReference[] typeArguments;
34
	public TypeReference[] typeArguments;
34
	public TypeBinding[] genericTypeArguments;
35
	public TypeBinding[] genericTypeArguments;
35
	public FieldDeclaration enumConstant; // for enum constant initializations
36
	public FieldDeclaration enumConstant; // for enum constant initializations
37
	protected TypeBinding typeExpected;	  // for <> inference
36
38
37
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
39
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
38
	// check captured variables are initialized in current context (26134)
40
	// check captured variables are initialized in current context (26134)
Lines 359-364 Link Here
359
		scope.problemReporter().cannotInstantiate(this.type, this.resolvedType);
361
		scope.problemReporter().cannotInstantiate(this.type, this.resolvedType);
360
		return this.resolvedType;
362
		return this.resolvedType;
361
	}
363
	}
364
	if (this.type != null && (this.type.bits & ASTNode.IsDiamond) != 0) {
365
		TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) this.resolvedType).genericType(), argumentTypes, scope);
366
		this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType());
367
 	}
362
	ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType;
368
	ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType;
363
	if (!(this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) {
369
	if (!(this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) {
364
		if (this.binding.declaringClass == null) {
370
		if (this.binding.declaringClass == null) {
Lines 384-389 Link Here
384
	return allocationType;
390
	return allocationType;
385
}
391
}
386
392
393
public TypeBinding[] inferElidedTypes(ReferenceBinding allocationType, TypeBinding[] argumentTypes, final BlockScope scope) {
394
	/* Given the allocation type and the arguments to the constructor, see if we can synthesize a generic static factory
395
	   method that would, given the argument types and the invocation site, manufacture a parameterized object of type allocationType.
396
	   If we are successful then by design and construction, the parameterization of the return type of the factory method is identical
397
	   to the types elided in the <>.
398
	 */   
399
	MethodBinding factory = scope.getStaticFactory(allocationType, argumentTypes, this);
400
	if (factory instanceof ParameterizedGenericMethodBinding && factory.isValidBinding()) {
401
		return ((ParameterizedTypeBinding)factory.returnType).arguments;
402
	}
403
	scope.problemReporter().cannotInferElidedTypes(this);
404
	int arity = allocationType.typeVariables().length;
405
	TypeBinding [] inferredTypes = new TypeBinding[arity];
406
	for (int i = 0; i < arity; i++) {
407
		inferredTypes[i] = new ProblemReferenceBinding(CharOperation.NO_CHAR_CHAR, null, ProblemReasons.InferenceFailed);
408
	}
409
	return inferredTypes;
410
}
411
387
public void setActualReceiverType(ReferenceBinding receiverType) {
412
public void setActualReceiverType(ReferenceBinding receiverType) {
388
	// ignored
413
	// ignored
389
}
414
}
Lines 413-416 Link Here
413
	}
438
	}
414
	visitor.endVisit(this, scope);
439
	visitor.endVisit(this, scope);
415
}
440
}
441
/**
442
 * @see org.eclipse.jdt.internal.compiler.ast.Expression#setExpectedType(org.eclipse.jdt.internal.compiler.lookup.TypeBinding)
443
 */
444
public void setExpectedType(TypeBinding expectedType) {
445
	this.typeExpected = expectedType;
446
}
447
/**
448
 * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#expectedType()
449
 */
450
public TypeBinding expectedType() {
451
	return this.typeExpected;
452
}
453
416
}
454
}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java (-6 / +7 lines)
Lines 253-259 Link Here
253
						scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes, i);
253
						scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes, i);
254
						return null;
254
						return null;
255
					}
255
					}
256
					checkBounds = false; // successful <> inference needs no bounds check, we will scream foul if needed during inference.
257
				}
256
				}
258
				// check parameterizing non-static member type of raw type
257
				// check parameterizing non-static member type of raw type
259
				if (typeIsConsistent && !currentType.isStatic()) {
258
				if (typeIsConsistent && !currentType.isStatic()) {
Lines 265-275 Link Here
265
					}
264
					}
266
				}
265
				}
267
				ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType(currentOriginal, argTypes, qualifyingType);
266
				ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType(currentOriginal, argTypes, qualifyingType);
268
				// check argument type compatibility
267
				// check argument type compatibility for non <> cases - <> case needs no bounds check, we will scream foul if needed during inference.
269
				if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution
268
				if (!isDiamond) {
270
					parameterizedType.boundCheck(scope, args);
269
					if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution
271
				else
270
						parameterizedType.boundCheck(scope, args);
272
					scope.deferBoundCheck(this);
271
					else
272
						scope.deferBoundCheck(this);
273
				}
273
				qualifyingType = parameterizedType;
274
				qualifyingType = parameterizedType;
274
		    } else {
275
		    } else {
275
				ReferenceBinding currentOriginal = (ReferenceBinding)currentType.original();
276
				ReferenceBinding currentOriginal = (ReferenceBinding)currentType.original();
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java (-7 / +9 lines)
Lines 209-214 Link Here
209
				return null;
209
				return null;
210
		}
210
		}
211
211
212
		final boolean isDiamond = (this.bits & ASTNode.IsDiamond) != 0;
212
		TypeVariableBinding[] typeVariables = currentOriginal.typeVariables();
213
		TypeVariableBinding[] typeVariables = currentOriginal.typeVariables();
213
		if (typeVariables == Binding.NO_TYPE_VARIABLES) { // non generic invoked with arguments
214
		if (typeVariables == Binding.NO_TYPE_VARIABLES) { // non generic invoked with arguments
214
			boolean isCompliant15 = scope.compilerOptions().originalSourceLevel >= ClassFileConstants.JDK1_5;
215
			boolean isCompliant15 = scope.compilerOptions().originalSourceLevel >= ClassFileConstants.JDK1_5;
Lines 227-237 Link Here
227
			}
228
			}
228
			// if missing generic type, and compliance >= 1.5, then will rebuild a parameterized binding
229
			// if missing generic type, and compliance >= 1.5, then will rebuild a parameterized binding
229
		} else if (argLength != typeVariables.length) {
230
		} else if (argLength != typeVariables.length) {
230
			if ((this.bits & ASTNode.IsDiamond) == 0) { // check arity, IsDiamond never set for 1.6-
231
			if (!isDiamond) { // check arity, IsDiamond never set for 1.6-
231
				scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes);
232
				scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes);
232
				return null;
233
				return null;
233
			} 
234
			} 
234
			checkBounds = false; // successful <> inference needs no bounds check, we will scream foul if needed during inference.
235
		} else if (!currentType.isStatic()) {
235
		} else if (!currentType.isStatic()) {
236
			ReferenceBinding actualEnclosing = currentType.enclosingType();
236
			ReferenceBinding actualEnclosing = currentType.enclosingType();
237
			if (actualEnclosing != null && actualEnclosing.isRawType()){
237
			if (actualEnclosing != null && actualEnclosing.isRawType()){
Lines 242-252 Link Here
242
		}
242
		}
243
243
244
    	ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType(currentOriginal, argTypes, enclosingType);
244
    	ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType(currentOriginal, argTypes, enclosingType);
245
		// check argument type compatibility
245
		// check argument type compatibility for non <> cases - <> case needs no bounds check, we will scream foul if needed during inference.
246
		if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution
246
    	if (!isDiamond) {
247
			parameterizedType.boundCheck(scope, this.typeArguments);
247
    		if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution
248
		else
248
    			parameterizedType.boundCheck(scope, this.typeArguments);
249
			scope.deferBoundCheck(this);
249
    		else
250
    			scope.deferBoundCheck(this);
251
    	}
250
		if (isTypeUseDeprecated(parameterizedType, scope))
252
		if (isTypeUseDeprecated(parameterizedType, scope))
251
			reportDeprecatedType(parameterizedType, scope);
253
			reportDeprecatedType(parameterizedType, scope);
252
254
(-)compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java (+5 lines)
Lines 27-32 Link Here
27
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
27
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
28
import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
28
import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
29
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
29
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
30
import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
30
import org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding;
31
import org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding;
31
import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
32
import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
32
import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
33
import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
Lines 385-390 Link Here
385
				scope.problemReporter().cannotInstantiate(this.type, receiverType);
386
				scope.problemReporter().cannotInstantiate(this.type, receiverType);
386
				return this.resolvedType = receiverType;
387
				return this.resolvedType = receiverType;
387
			}
388
			}
389
			if (this.type != null && (this.type.bits & ASTNode.IsDiamond) != 0) {
390
				TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) receiverType).genericType(), argumentTypes, scope);
391
				receiverType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) receiverType).genericType(), inferredTypes, ((ParameterizedTypeBinding) receiverType).enclosingType());
392
			}
388
			ReferenceBinding allocationType = (ReferenceBinding) receiverType;
393
			ReferenceBinding allocationType = (ReferenceBinding) receiverType;
389
			if ((this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) {
394
			if ((this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) {
390
				if (isMethodUseDeprecated(this.binding, scope, true)) {
395
				if (isMethodUseDeprecated(this.binding, scope, true)) {
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java (+1 lines)
Lines 31-34 Link Here
31
	final int TypeArgumentsForRawGenericMethod = 13; // for generic method
31
	final int TypeArgumentsForRawGenericMethod = 13; // for generic method
32
	final int InvalidTypeForStaticImport = 14;
32
	final int InvalidTypeForStaticImport = 14;
33
	final int InvalidTypeForAutoManagedResource = 15;
33
	final int InvalidTypeForAutoManagedResource = 15;
34
	final int InferenceFailed = 16;
34
}
35
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (+134 lines)
Lines 25-30 Link Here
25
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
25
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
26
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
26
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
27
import org.eclipse.jdt.internal.compiler.util.ObjectVector;
27
import org.eclipse.jdt.internal.compiler.util.ObjectVector;
28
import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
28
import org.eclipse.jdt.internal.compiler.util.SimpleSet;
29
import org.eclipse.jdt.internal.compiler.util.SimpleSet;
29
30
30
public abstract class Scope {
31
public abstract class Scope {
Lines 4023-4026 Link Here
4023
	int startIndex() {
4024
	int startIndex() {
4024
		return 0;
4025
		return 0;
4025
	}
4026
	}
4027
	/* Given an allocation type and arguments at the allocation site, answer a synthetic generic static factory method
4028
	   that could instead be invoked with identical results. Return null if no compatible, visible, most specific method
4029
	   could be found. This method is modeled after Scope.getConstructor and Scope.getMethod.
4030
	 */
4031
	public MethodBinding getStaticFactory (ReferenceBinding allocationType, TypeBinding[] argumentTypes, final InvocationSite allocationSite) {
4032
		TypeVariableBinding[] classTypeVariables = allocationType.typeVariables();
4033
		int classTypeVariablesArity = classTypeVariables.length;
4034
		MethodBinding[] methods = allocationType.getMethods(TypeConstants.INIT, argumentTypes.length);
4035
		MethodBinding [] staticFactories = new MethodBinding[methods.length];
4036
		int sfi = 0;
4037
		for (int i = 0, length = methods.length; i < length; i++) {
4038
			MethodBinding method = methods[i];
4039
			
4040
			TypeVariableBinding[] methodTypeVariables = method.typeVariables();
4041
			int methodTypeVariablesArity = methodTypeVariables.length;
4042
	        
4043
			final TypeBinding[] genericTypeArguments = allocationSite.genericTypeArguments();
4044
			if (genericTypeArguments != null && genericTypeArguments.length < methodTypeVariablesArity)
4045
				continue; // wrong tree, don't bark.
4046
			MethodBinding staticFactory = new MethodBinding(method.modifiers | ClassFileConstants.AccStatic, TypeConstants.SYNTHETIC_STATIC_FACTORY,
4047
																		null, null, null, method.declaringClass);
4048
			staticFactory.typeVariables = new TypeVariableBinding[classTypeVariablesArity + (genericTypeArguments == null ? methodTypeVariablesArity : 0)];
4049
			final SimpleLookupTable map = new SimpleLookupTable(classTypeVariablesArity + methodTypeVariablesArity);
4050
			// Rename each type variable T of the type to T'
4051
			final LookupEnvironment environment = environment();
4052
			for (int j = 0; j < classTypeVariablesArity; j++) {
4053
				map.put(classTypeVariables[j], staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(classTypeVariables[j].sourceName, "'".toCharArray()), //$NON-NLS-1$
4054
																			staticFactory, j, environment));
4055
			}
4056
			// Rename each type variable U of method U to U'' if not explicitly parameterized. Otherwise use the parameterizing type.
4057
			for (int j = classTypeVariablesArity, max = classTypeVariablesArity + methodTypeVariablesArity; j < max; j++) {
4058
				map.put(methodTypeVariables[j - classTypeVariablesArity], 
4059
						genericTypeArguments != null ? genericTypeArguments[j - classTypeVariablesArity] :
4060
							(staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(methodTypeVariables[j - classTypeVariablesArity].sourceName, "''".toCharArray()), //$NON-NLS-1$
4061
																			staticFactory, j, environment)));
4062
			}
4063
			final Scope scope = this;
4064
			Substitution substitution = new Substitution() {
4065
					public LookupEnvironment environment() {
4066
						return scope.environment();
4067
					}
4068
					public boolean isRawSubstitution() {
4069
						return false;
4070
					}
4071
					public TypeBinding substitute(TypeVariableBinding typeVariable) {
4072
						return (TypeBinding) map.get(typeVariable);
4073
					}
4074
				};
4075
4076
			// initialize new variable bounds
4077
			for (int j = 0, max = classTypeVariablesArity + methodTypeVariablesArity; j < max; j++) {
4078
				TypeVariableBinding originalVariable = j < classTypeVariablesArity ? classTypeVariables[j] : methodTypeVariables[j - classTypeVariablesArity];
4079
				TypeBinding substitutedType = (TypeBinding) map.get(originalVariable);
4080
				if (substitutedType instanceof TypeVariableBinding) {
4081
					TypeVariableBinding substitutedVariable = (TypeVariableBinding) substitutedType;
4082
					TypeBinding substitutedSuperclass = Scope.substitute(substitution, originalVariable.superclass);
4083
					ReferenceBinding[] substitutedInterfaces = Scope.substitute(substitution, originalVariable.superInterfaces);
4084
					if (originalVariable.firstBound != null) {
4085
						substitutedVariable.firstBound = originalVariable.firstBound == originalVariable.superclass
4086
								? substitutedSuperclass // could be array type or interface
4087
										: substitutedInterfaces[0];
4088
					}
4089
					switch (substitutedSuperclass.kind()) {
4090
						case Binding.ARRAY_TYPE :
4091
							substitutedVariable.superclass = environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null);
4092
							substitutedVariable.superInterfaces = substitutedInterfaces;
4093
							break;
4094
						default:
4095
							if (substitutedSuperclass.isInterface()) {
4096
								substitutedVariable.superclass = environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null);
4097
								int interfaceCount = substitutedInterfaces.length;
4098
								System.arraycopy(substitutedInterfaces, 0, substitutedInterfaces = new ReferenceBinding[interfaceCount+1], 1, interfaceCount);
4099
								substitutedInterfaces[0] = (ReferenceBinding) substitutedSuperclass;
4100
								substitutedVariable.superInterfaces = substitutedInterfaces;
4101
							} else {
4102
								substitutedVariable.superclass = (ReferenceBinding) substitutedSuperclass; // typeVar was extending other typeVar which got substituted with interface
4103
								substitutedVariable.superInterfaces = substitutedInterfaces;
4104
							}
4105
					}
4106
				}
4107
			}
4108
		    TypeVariableBinding[] returnTypeParameters = new TypeVariableBinding[classTypeVariablesArity];
4109
			for (int j = 0; j < classTypeVariablesArity; j++) {
4110
				returnTypeParameters[j] = (TypeVariableBinding) map.get(classTypeVariables[j]);
4111
			}
4112
			staticFactory.returnType = environment.createParameterizedType(allocationType, returnTypeParameters, allocationType.enclosingType());
4113
			staticFactory.parameters = Scope.substitute(substitution, method.parameters);
4114
			staticFactory.thrownExceptions = Scope.substitute(substitution, method.thrownExceptions);
4115
			if (staticFactory.thrownExceptions == null) { 
4116
				staticFactory.thrownExceptions = Binding.NO_EXCEPTIONS;
4117
			}
4118
			staticFactories[sfi++] = new ParameterizedMethodBinding((ParameterizedTypeBinding) environment.convertToParameterizedType(staticFactory.declaringClass),
4119
																												staticFactory);
4120
		}
4121
		if (sfi != methods.length) {
4122
			System.arraycopy(staticFactories, 0, staticFactories = new MethodBinding[sfi], 0, sfi);
4123
		}
4124
		InvocationSite site = new InvocationSite() { // Alternate site to not expose the generic type arguments as they have already been substituted.
4125
			public int sourceStart() { return allocationSite.sourceStart(); }
4126
			public int sourceEnd() { return allocationSite.sourceEnd(); }
4127
			public void setFieldIndex(int depth) {	allocationSite.setFieldIndex(depth);	}
4128
			public void setDepth(int depth) { allocationSite.setDepth(depth);}
4129
			public void setActualReceiverType(ReferenceBinding receiverType) { allocationSite.setActualReceiverType(receiverType);}
4130
			public boolean isTypeAccess() { return allocationSite.isTypeAccess(); }
4131
			public boolean isSuperAccess() { return allocationSite.isSuperAccess(); }
4132
			public TypeBinding[] genericTypeArguments() { return null; }
4133
			public TypeBinding expectedType() { return allocationSite.expectedType(); }
4134
		};
4135
		MethodBinding[] compatible = new MethodBinding[sfi];
4136
		int compatibleIndex = 0;
4137
		for (int i = 0; i < sfi; i++) {
4138
			MethodBinding compatibleMethod = computeCompatibleMethod(staticFactories[i], argumentTypes, site);
4139
			if (compatibleMethod != null) {
4140
				if (compatibleMethod.isValidBinding())
4141
					compatible[compatibleIndex++] = compatibleMethod;
4142
			}
4143
		}
4144
4145
		if (compatibleIndex == 0) {
4146
			return null;
4147
		}
4148
		MethodBinding[] visible = new MethodBinding[compatibleIndex];
4149
		int visibleIndex = 0;
4150
		for (int i = 0; i < compatibleIndex; i++) {
4151
			MethodBinding method = compatible[i];
4152
			if (method.canBeSeenBy(allocationSite, this))
4153
				visible[visibleIndex++] = method;
4154
		}
4155
		if (visibleIndex == 0) {
4156
			return null;
4157
		}
4158
		return visibleIndex == 1 ? visible[0] : mostSpecificMethodBinding(visible, visibleIndex, argumentTypes, allocationSite, allocationType);
4159
	}
4026
}
4160
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java (+1 lines)
Lines 170-175 Link Here
170
	char[] SYNTHETIC_ENCLOSING_INSTANCE_PREFIX = "this$".toCharArray(); //$NON-NLS-1$
170
	char[] SYNTHETIC_ENCLOSING_INSTANCE_PREFIX = "this$".toCharArray(); //$NON-NLS-1$
171
	char[] SYNTHETIC_ACCESS_METHOD_PREFIX =  "access$".toCharArray(); //$NON-NLS-1$
171
	char[] SYNTHETIC_ACCESS_METHOD_PREFIX =  "access$".toCharArray(); //$NON-NLS-1$
172
	char[] SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX =  " enum constant initialization$".toCharArray(); //$NON-NLS-1$
172
	char[] SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX =  " enum constant initialization$".toCharArray(); //$NON-NLS-1$
173
	char[] SYNTHETIC_STATIC_FACTORY =  "<factory>".toCharArray(); //$NON-NLS-1$
173
174
174
	// synthetic package-info name
175
	// synthetic package-info name
175
	public static final char[] PACKAGE_INFO_NAME = "package-info".toCharArray(); //$NON-NLS-1$
176
	public static final char[] PACKAGE_INFO_NAME = "package-info".toCharArray(); //$NON-NLS-1$
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (+8 lines)
Lines 7748-7751 Link Here
7748
			resources[0].declarationSourceStart,
7748
			resources[0].declarationSourceStart,
7749
			resources[resources.length - 1].declarationSourceEnd);
7749
			resources[resources.length - 1].declarationSourceEnd);
7750
}
7750
}
7751
public void cannotInferElidedTypes(AllocationExpression allocationExpression) {
7752
	this.handle(
7753
			IProblem.CannotInferElidedTypes,
7754
			NoArgument,
7755
			NoArgument,
7756
			allocationExpression.sourceStart, 
7757
			allocationExpression.sourceEnd);
7758
}
7751
}
7759
}
(-)compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (+1 lines)
Lines 639-644 Link Here
639
875 = Multi-catch parameters are not allowed for source level below 1.7
639
875 = Multi-catch parameters are not allowed for source level below 1.7
640
876 = Invocation of polymorphic methods not allowed for source level below 1.7
640
876 = Invocation of polymorphic methods not allowed for source level below 1.7
641
877 = Cannot switch on a value of type {0}. Only convertible int values, strings or enum constants are permitted
641
877 = Cannot switch on a value of type {0}. Only convertible int values, strings or enum constants are permitted
642
878 = Cannot infer elided type(s)
642
643
643
### ELABORATIONS
644
### ELABORATIONS
644
## Access restrictions
645
## Access restrictions
(-)src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java (+2 lines)
Lines 382-387 Link Here
382
		expectedProblemAttributes.put("CannotExtendEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
382
		expectedProblemAttributes.put("CannotExtendEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
383
		expectedProblemAttributes.put("CannotHideAnInstanceMethodWithAStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
383
		expectedProblemAttributes.put("CannotHideAnInstanceMethodWithAStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
384
		expectedProblemAttributes.put("CannotImportPackage", new ProblemAttributes(CategorizedProblem.CAT_IMPORT));
384
		expectedProblemAttributes.put("CannotImportPackage", new ProblemAttributes(CategorizedProblem.CAT_IMPORT));
385
		expectedProblemAttributes.put("CannotInferElidedTypes", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
385
		expectedProblemAttributes.put("CannotInvokeSuperConstructorInEnum", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
386
		expectedProblemAttributes.put("CannotInvokeSuperConstructorInEnum", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
386
		expectedProblemAttributes.put("CannotOverrideAStaticMethodWithAnInstanceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
387
		expectedProblemAttributes.put("CannotOverrideAStaticMethodWithAnInstanceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
387
		expectedProblemAttributes.put("CannotReadSource", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
388
		expectedProblemAttributes.put("CannotReadSource", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
Lines 1041-1046 Link Here
1041
		expectedProblemAttributes.put("CannotExtendEnum", SKIP);
1042
		expectedProblemAttributes.put("CannotExtendEnum", SKIP);
1042
		expectedProblemAttributes.put("CannotHideAnInstanceMethodWithAStaticMethod", SKIP);
1043
		expectedProblemAttributes.put("CannotHideAnInstanceMethodWithAStaticMethod", SKIP);
1043
		expectedProblemAttributes.put("CannotImportPackage", SKIP);
1044
		expectedProblemAttributes.put("CannotImportPackage", SKIP);
1045
		expectedProblemAttributes.put("CannotInferElidedTypes", SKIP);
1044
		expectedProblemAttributes.put("CannotInvokeSuperConstructorInEnum", SKIP);
1046
		expectedProblemAttributes.put("CannotInvokeSuperConstructorInEnum", SKIP);
1045
		expectedProblemAttributes.put("CannotOverrideAStaticMethodWithAnInstanceMethod", SKIP);
1047
		expectedProblemAttributes.put("CannotOverrideAStaticMethodWithAnInstanceMethod", SKIP);
1046
		expectedProblemAttributes.put("CannotReadSource", SKIP);
1048
		expectedProblemAttributes.put("CannotReadSource", SKIP);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java (-41 / +106 lines)
Lines 28-34 Link Here
28
public static Test suite() {
28
public static Test suite() {
29
	return buildMinimalComplianceTestSuite(testClass(), F_1_7);
29
	return buildMinimalComplianceTestSuite(testClass(), F_1_7);
30
}
30
}
31
public void _test001() {
31
public void test001() {
32
	this.runConformTest(
32
	this.runConformTest(
33
		new String[] {
33
		new String[] {
34
			"X.java",
34
			"X.java",
Lines 44-50 Link Here
44
		},
44
		},
45
		"SUCCESS");
45
		"SUCCESS");
46
}
46
}
47
public void _test001a() {
47
public void test001a() {
48
	this.runNegativeTest(
48
	this.runNegativeTest(
49
		new String[] {
49
		new String[] {
50
			"X.java",
50
			"X.java",
Lines 65-71 Link Here
65
		"The method testFunction(String) in the type X<String> is not applicable for the arguments (int)\n" + 
65
		"The method testFunction(String) in the type X<String> is not applicable for the arguments (int)\n" + 
66
		"----------\n");
66
		"----------\n");
67
}
67
}
68
public void _test001b() {
68
public void test001b() {
69
	this.runConformTest(
69
	this.runConformTest(
70
		new String[] {
70
		new String[] {
71
			"X.java",
71
			"X.java",
Lines 80-86 Link Here
80
		"SUCCESS");
80
		"SUCCESS");
81
}
81
}
82
// fields
82
// fields
83
public void _test001b_1() {
83
public void test001b_1() {
84
	this.runConformTest(
84
	this.runConformTest(
85
		new String[] {
85
		new String[] {
86
			"X.java",
86
			"X.java",
Lines 94-100 Link Here
94
		},
94
		},
95
		"SUCCESS");
95
		"SUCCESS");
96
}
96
}
97
public void _test001c() {
97
public void test001c() {
98
	this.runNegativeTest(
98
	this.runNegativeTest(
99
		new String[] {
99
		new String[] {
100
			"X.java",
100
			"X.java",
Lines 114-120 Link Here
114
		"----------\n");
114
		"----------\n");
115
}
115
}
116
// fields
116
// fields
117
public void _test001c_1() {
117
public void test001c_1() {
118
	this.runNegativeTest(
118
	this.runNegativeTest(
119
		new String[] {
119
		new String[] {
120
			"X.java",
120
			"X.java",
Lines 133-139 Link Here
133
		"The method add(int, String) in the type ArrayList<String> is not applicable for the arguments (int)\n" + 
133
		"The method add(int, String) in the type ArrayList<String> is not applicable for the arguments (int)\n" + 
134
		"----------\n");
134
		"----------\n");
135
}
135
}
136
public void _test001d() {
136
public void test001d() {
137
	this.runNegativeTest(
137
	this.runNegativeTest(
138
		new String[] {
138
		new String[] {
139
			"X.java",
139
			"X.java",
Lines 155-161 Link Here
155
		"The method ab(ArrayList<String>) in the type X<String> is not applicable for the arguments (ArrayList<Object>)\n" + 
155
		"The method ab(ArrayList<String>) in the type X<String> is not applicable for the arguments (ArrayList<Object>)\n" + 
156
		"----------\n");
156
		"----------\n");
157
}
157
}
158
public void _test001e() {
158
public void test001e() {
159
	this.runNegativeTest(
159
	this.runNegativeTest(
160
		new String[] {
160
		new String[] {
161
			"X.java",
161
			"X.java",
Lines 177-184 Link Here
177
		"The method ab(ArrayList<String>) in the type X<String> is not applicable for the arguments (ArrayList<Object>)\n" + 
177
		"The method ab(ArrayList<String>) in the type X<String> is not applicable for the arguments (ArrayList<Object>)\n" + 
178
		"----------\n");
178
		"----------\n");
179
}
179
}
180
public void _test001f() {
180
public void test001f() {
181
	this.runConformTest(
181
	this.runNegativeTest(
182
		new String[] {
182
		new String[] {
183
			"X.java",
183
			"X.java",
184
			"public class X<T> {\n" +
184
			"public class X<T> {\n" +
Lines 193-199 Link Here
193
			"	}\n" +
193
			"	}\n" +
194
			"}",
194
			"}",
195
		},
195
		},
196
		"SUCCESS");
196
		"----------\n" + 
197
		"1. WARNING in X.java (at line 2)\n" + 
198
		"	class X2<T>{\n" + 
199
		"	         ^\n" + 
200
		"The type parameter T is hiding the type T\n" + 
201
		"----------\n" + 
202
		"2. ERROR in X.java (at line 8)\n" + 
203
		"	X<String>.X2<String> x = new X<>().new X2<>();\n" + 
204
		"	                         ^^^^^^^^^^^^^^^^^^^^\n" + 
205
		"Type mismatch: cannot convert from X<Object>.X2<String> to X<String>.X2<String>\n" + 
206
		"----------\n");
197
}
207
}
198
// fields
208
// fields
199
public void test001f_1() {
209
public void test001f_1() {
Lines 216-223 Link Here
216
		},
226
		},
217
		"SUCCESS");
227
		"SUCCESS");
218
}
228
}
219
public void _test001g() {
229
public void test001g() {
220
	this.runConformTest(
230
	this.runNegativeTest(
221
		new String[] {
231
		new String[] {
222
			"X.java",
232
			"X.java",
223
			"public class X<T> {\n" +
233
			"public class X<T> {\n" +
Lines 233-239 Link Here
233
			"	}\n" +
243
			"	}\n" +
234
			"}",
244
			"}",
235
		},
245
		},
236
		"SUCCESS\n1");
246
		"----------\n" + 
247
		"1. ERROR in X.java (at line 9)\n" + 
248
		"	X<String>.X2<Integer> x = new X<>().new X2<>();\n" + 
249
		"	                          ^^^^^^^^^^^^^^^^^^^^\n" + 
250
		"Type mismatch: cannot convert from X<Object>.X2<Integer> to X<String>.X2<Integer>\n" + 
251
		"----------\n");
237
}
252
}
238
public void test001g_1() {
253
public void test001g_1() {
239
	this.runConformTest(
254
	this.runConformTest(
Lines 256-262 Link Here
256
		},
271
		},
257
		"SUCCESS\n1");
272
		"SUCCESS\n1");
258
}
273
}
259
public void _test001h() {
274
public void test001h() {
260
	this.runNegativeTest(
275
	this.runNegativeTest(
261
		new String[] {
276
		new String[] {
262
			"X.java",
277
			"X.java",
Lines 278-290 Link Here
278
		"	         ^\n" + 
293
		"	         ^\n" + 
279
		"The type parameter T is hiding the type T\n" + 
294
		"The type parameter T is hiding the type T\n" + 
280
		"----------\n" + 
295
		"----------\n" + 
281
		"2. ERROR in X.java (at line 9)\n" + 
296
		"2. ERROR in X.java (at line 8)\n" + 
297
		"	X<String>.X2<String> x = new X<>().new X2<>();\n" + 
298
		"	                         ^^^^^^^^^^^^^^^^^^^^\n" + 
299
		"Type mismatch: cannot convert from X<Object>.X2<String> to X<String>.X2<String>\n" + 
300
		"----------\n" + 
301
		"3. ERROR in X.java (at line 9)\n" + 
282
		"	x.methodx(1);\n" + 
302
		"	x.methodx(1);\n" + 
283
		"	  ^^^^^^^\n" + 
303
		"	  ^^^^^^^\n" + 
284
		"The method methodx(String) in the type X<String>.X2<String> is not applicable for the arguments (int)\n" + 
304
		"The method methodx(String) in the type X<String>.X2<String> is not applicable for the arguments (int)\n" + 
285
		"----------\n");
305
		"----------\n");
286
}
306
}
287
public void _test001h_1() {
307
public void test001h_1() {
288
	this.runNegativeTest(
308
	this.runNegativeTest(
289
		new String[] {
309
		new String[] {
290
			"X.java",
310
			"X.java",
Lines 329-339 Link Here
329
		"Type safety: The method methodx(Object) belongs to the raw type X.X2. References to generic type X<T>.X2<T> should be parameterized\n" + 
349
		"Type safety: The method methodx(Object) belongs to the raw type X.X2. References to generic type X<T>.X2<T> should be parameterized\n" + 
330
		"----------\n");
350
		"----------\n");
331
}
351
}
332
public void _test001i() {
352
public void test001h_2() {
333
	this.runConformTest(
353
	this.runConformTest(
334
		new String[] {
354
		new String[] {
335
			"X.java",
355
			"X.java",
336
			"public class X<T> {\n" +
356
			"public class X<T> {\n" +
357
			"	class X2<T>{\n" +
358
			"		void methodx(T param){\n" +
359
			"			System.out.println(param);\n" +
360
			"		}\n" +
361
			"	}\n" +
362
			"	X<String>.X2<String> x;\n" + 
363
			"	public static void main(String[] args) {\n" +
364
			"		X test = new X();\n" + 
365
			"		test.x = new X<>().new X2<>();\n" + 
366
			"		test.x.methodx(1);\n" + 
367
			"	}\n" +
368
			"}",
369
		},
370
		"1");
371
}
372
public void test001i() {
373
	this.runNegativeTest(
374
		new String[] {
375
			"X.java",
376
			"public class X<T> {\n" +
337
			"	class X2<K>{\n" +
377
			"	class X2<K>{\n" +
338
			"		class X22<I>{\n" +
378
			"		class X22<I>{\n" +
339
			"			void methodx(T param, K param2, I param3){\n" +
379
			"			void methodx(T param, K param2, I param3){\n" +
Lines 348-354 Link Here
348
			"	}\n" +
388
			"	}\n" +
349
			"}",
389
			"}",
350
		},
390
		},
351
		"SUCCESS");
391
		"----------\n" + 
392
		"1. ERROR in X.java (at line 10)\n" + 
393
		"	X<String> test = new X<>();		X<String>.X2<Integer>.X22<X<String>> x = new X<>().new X2<>().new X22<>();\n" + 
394
		"	                           		                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
395
		"Type mismatch: cannot convert from X<Object>.X2<Object>.X22<X<String>> to X<String>.X2<Integer>.X22<X<String>>\n" + 
396
		"----------\n");
352
}
397
}
353
public void test002() {
398
public void test002() {
354
	this.runNegativeTest(
399
	this.runNegativeTest(
Lines 376-382 Link Here
376
		"Type safety: The method testFunction(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" + 
421
		"Type safety: The method testFunction(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" + 
377
		"----------\n");
422
		"----------\n");
378
}
423
}
379
public void _test003() {
424
public void test003() {
380
	this.runConformTest(
425
	this.runConformTest(
381
		new String[] {
426
		new String[] {
382
			"X.java",
427
			"X.java",
Lines 392-398 Link Here
392
		"SUCCESS");
437
		"SUCCESS");
393
}
438
}
394
439
395
public void _test004b() {
440
public void test004b() {
396
	this.runNegativeTest(
441
	this.runNegativeTest(
397
		new String[] {
442
		new String[] {
398
			"X.java",
443
			"X.java",
Lines 437-443 Link Here
437
		"1");
482
		"1");
438
}
483
}
439
484
440
public void _test006() {
485
public void test006() {
441
	this.runConformTest(
486
	this.runConformTest(
442
		new String[] {
487
		new String[] {
443
			"X.java",
488
			"X.java",
Lines 460-466 Link Here
460
		"SUCCESS");
505
		"SUCCESS");
461
}
506
}
462
// shows the difference between using <> and the raw type - different semantics
507
// shows the difference between using <> and the raw type - different semantics
463
public void _test007() {
508
public void test007() {
464
	this.runConformTest(
509
	this.runConformTest(
465
		new String[] {
510
		new String[] {
466
			"X.java",
511
			"X.java",
Lines 487-493 Link Here
487
		"1\n" + 
532
		"1\n" + 
488
		"2");
533
		"2");
489
}
534
}
490
public void _test007a() {
535
public void test007a() {
491
	this.runNegativeTest(
536
	this.runNegativeTest(
492
		new String[] {
537
		new String[] {
493
			"X.java",
538
			"X.java",
Lines 529-540 Link Here
529
		"----------\n");
574
		"----------\n");
530
}
575
}
531
//shows the difference between using <> and the raw type - different semantics
576
//shows the difference between using <> and the raw type - different semantics
532
public void _test008() {
577
public void test008() {
533
	this.runConformTest(
578
	this.runNegativeTest(
534
		new String[] {
579
		new String[] {
535
			"X.java",
580
			"X.java",
536
			"public class X<T> {\n" +
581
			"public class X<T> {\n" +
537
			"	T field1;" +
582
			"	T field1;\n" +
538
			"	public X(T param){\n" +
583
			"	public X(T param){\n" +
539
			"		field1 = param;\n" +
584
			"		field1 = param;\n" +
540
			"	}\n" +
585
			"	}\n" +
Lines 547-556 Link Here
547
			"	}\n" + 
592
			"	}\n" + 
548
			"}",
593
			"}",
549
		},
594
		},
550
		"");
595
		"----------\n" + 
596
		"1. WARNING in X.java (at line 7)\n" + 
597
		"	X<?> x1 = new X(1).get(\"\");\n" + 
598
		"	          ^^^^^^^^\n" + 
599
		"Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" + 
600
		"----------\n" + 
601
		"2. WARNING in X.java (at line 7)\n" + 
602
		"	X<?> x1 = new X(1).get(\"\");\n" + 
603
		"	          ^^^^^^^^^^^^^^^^\n" + 
604
		"Type safety: The method get(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" + 
605
		"----------\n" + 
606
		"3. WARNING in X.java (at line 7)\n" + 
607
		"	X<?> x1 = new X(1).get(\"\");\n" + 
608
		"	              ^\n" + 
609
		"X is a raw type. References to generic type X<T> should be parameterized\n" + 
610
		"----------\n" + 
611
		"4. ERROR in X.java (at line 8)\n" + 
612
		"	X<?> x2 = new X<>(1).get(\"\");\n" + 
613
		"	                     ^^^\n" + 
614
		"The method get(Integer) in the type X<Integer> is not applicable for the arguments (String)\n" + 
615
		"----------\n");
551
}
616
}
552
617
553
public void _test0014() {
618
public void test0014() {
554
	this.runConformTest(
619
	this.runConformTest(
555
		new String[] {
620
		new String[] {
556
			"X.java",
621
			"X.java",
Lines 568-574 Link Here
568
		"SUCCESS\n" +
633
		"SUCCESS\n" +
569
		"123");
634
		"123");
570
}
635
}
571
public void _test0014a() {
636
public void test0014a() {
572
	this.runNegativeTest(
637
	this.runNegativeTest(
573
		new String[] {
638
		new String[] {
574
			"X.java",
639
			"X.java",
Lines 590-596 Link Here
590
		"The method testFunction(String, Integer) in the type X<String,Integer> is not applicable for the arguments (int, String)\n" + 
655
		"The method testFunction(String, Integer) in the type X<String,Integer> is not applicable for the arguments (int, String)\n" + 
591
		"----------\n");
656
		"----------\n");
592
}
657
}
593
public void _test0015() {
658
public void test0015() {
594
	this.runConformTest(
659
	this.runConformTest(
595
		new String[] {
660
		new String[] {
596
			"X.java",
661
			"X.java",
Lines 611-618 Link Here
611
}
676
}
612
// To verify that a parameterized invocation of a generic constructor works even if <> is used
677
// To verify that a parameterized invocation of a generic constructor works even if <> is used
613
// to elide class type parameters.
678
// to elide class type parameters.
614
public void _test0016() {
679
public void test0016() {
615
	this.runConformTest(
680
	this.runConformTest(  // javac fails to compile this, looks buggy
616
		new String[] {
681
		new String[] {
617
			"X.java",
682
			"X.java",
618
			"public class X<T> {\n" +
683
			"public class X<T> {\n" +
Lines 632-639 Link Here
632
}
697
}
633
// To verify that a parameterized invocation of a generic constructor works even if <> is used
698
// To verify that a parameterized invocation of a generic constructor works even if <> is used
634
// to elide class type parameters. This test handles fields
699
// to elide class type parameters. This test handles fields
635
public void _test0016b() {
700
public void test0016b() {
636
	this.runConformTest(
701
	this.runConformTest(  // javac fails to compile this, looks buggy
637
		new String[] {
702
		new String[] {
638
			"X.java",
703
			"X.java",
639
			"public class X<T> {\n" +
704
			"public class X<T> {\n" +
Lines 657-664 Link Here
657
// To verify that a parameterized invocation of a non-generic constructor works even if <> is used
722
// To verify that a parameterized invocation of a non-generic constructor works even if <> is used
658
// to elide class type parameters.
723
// to elide class type parameters.
659
// This was not allowed in java 1.6 and 1.5 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=168230)
724
// This was not allowed in java 1.6 and 1.5 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=168230)
660
public void _test0017() {
725
public void test0017() {
661
	this.runConformTest(
726
	this.runConformTest( // javac fails to compile this, looks buggy
662
		new String[] {
727
		new String[] {
663
			"X.java",
728
			"X.java",
664
			"public class X<T> {\n" +
729
			"public class X<T> {\n" +
Lines 679-685 Link Here
679
		"const.1\nconst.1\nconst.2");
744
		"const.1\nconst.1\nconst.2");
680
}
745
}
681
// To verify that the correct constructor is found by parameter substitution in the diamond case
746
// To verify that the correct constructor is found by parameter substitution in the diamond case
682
public void _test0018() {
747
public void test0018() {
683
	this.runConformTest(
748
	this.runConformTest(
684
		new String[] {
749
		new String[] {
685
			"X.java",
750
			"X.java",
Lines 700-706 Link Here
700
}
765
}
701
// To verify that the correct constructor is found by parameter substitution 
766
// To verify that the correct constructor is found by parameter substitution 
702
// in the diamond case -- fields
767
// in the diamond case -- fields
703
public void _test0018b() {
768
public void test0018b() {
704
	this.runConformTest(
769
	this.runConformTest(
705
		new String[] {
770
		new String[] {
706
			"X.java",
771
			"X.java",
Lines 738-744 Link Here
738
		"----------\n");
803
		"----------\n");
739
}
804
}
740
// check inference at method argument position.
805
// check inference at method argument position.
741
public void _test0020() {
806
public void test0020() {
742
	this.runNegativeTest(
807
	this.runNegativeTest(
743
		new String[] {
808
		new String[] {
744
			"X.java",
809
			"X.java",
Lines 757-763 Link Here
757
		"----------\n");
822
		"----------\n");
758
}
823
}
759
//check inference at method argument position.
824
//check inference at method argument position.
760
public void _test0021() {
825
public void test0021() {
761
	this.runNegativeTest(
826
	this.runNegativeTest(
762
		new String[] {
827
		new String[] {
763
			"X.java",
828
			"X.java",

Return to bug 339478