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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java (-2 / +6 lines)
Lines 345-351 Link Here
345
}
345
}
346
346
347
// anonymous type constructor creation: rank is important since bindings already got sorted
347
// anonymous type constructor creation: rank is important since bindings already got sorted
348
public MethodBinding createDefaultConstructorWithBinding(MethodBinding inheritedConstructorBinding) {
348
public MethodBinding createDefaultConstructorWithBinding(MethodBinding inheritedConstructorBinding, boolean isUnchecked) {
349
	//Add to method'set, the default constuctor that just recall the
349
	//Add to method'set, the default constuctor that just recall the
350
	//super constructor with the same arguments
350
	//super constructor with the same arguments
351
	String baseName = "$anonymous"; //$NON-NLS-1$
351
	String baseName = "$anonymous"; //$NON-NLS-1$
Lines 393-403 Link Here
393
	}
393
	}
394
394
395
	//============BINDING UPDATE==========================
395
	//============BINDING UPDATE==========================
396
	ReferenceBinding[] thrownExceptions = isUnchecked
397
			? this.scope.environment().convertToRawTypes(inheritedConstructorBinding.original().thrownExceptions, true, true)
398
			: inheritedConstructorBinding.thrownExceptions;
399
396
	SourceTypeBinding sourceType = this.binding;
400
	SourceTypeBinding sourceType = this.binding;
397
	constructor.binding = new MethodBinding(
401
	constructor.binding = new MethodBinding(
398
			constructor.modifiers, //methodDeclaration
402
			constructor.modifiers, //methodDeclaration
399
			argumentsLength == 0 ? Binding.NO_PARAMETERS : argumentTypes, //arguments bindings
403
			argumentsLength == 0 ? Binding.NO_PARAMETERS : argumentTypes, //arguments bindings
400
			inheritedConstructorBinding.thrownExceptions, //exceptions
404
			thrownExceptions, //exceptions
401
			sourceType); //declaringClass
405
			sourceType); //declaringClass
402
	constructor.binding.tagBits |= (inheritedConstructorBinding.tagBits & TagBits.HasMissingType);
406
	constructor.binding.tagBits |= (inheritedConstructorBinding.tagBits & TagBits.HasMissingType);
403
	constructor.binding.modifiers |= ExtraCompilerModifiers.AccIsDefaultConstructor;
407
	constructor.binding.modifiers |= ExtraCompilerModifiers.AccIsDefaultConstructor;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java (+4 lines)
Lines 609-614 Link Here
609
	// ignored
609
	// ignored
610
}
610
}
611
611
612
public void setUnchecked(boolean isUnchecked) {
613
	// ignored
614
}
615
612
public void traverse(ASTVisitor visitor, BlockScope scope) {
616
public void traverse(ASTVisitor visitor, BlockScope scope) {
613
	if (visitor.visit(this, scope)) {
617
	if (visitor.visit(this, scope)) {
614
		this.receiver.traverse(visitor, scope);
618
		this.receiver.traverse(visitor, scope);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java (+5 lines)
Lines 128-131 Link Here
128
	public void setFieldIndex(int depth) {
128
	public void setFieldIndex(int depth) {
129
		// do nothing by default
129
		// do nothing by default
130
	}
130
	}
131
	
132
	public void setUnchecked(boolean isUnchecked) {
133
		// ignored
134
	}
135
	
131
}
136
}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java (-1 / +3 lines)
Lines 256-261 Link Here
256
			public void setActualReceiverType(ReferenceBinding actualReceiverType) { /* ignore */}
256
			public void setActualReceiverType(ReferenceBinding actualReceiverType) { /* ignore */}
257
			public void setDepth(int depth) { /* ignore */}
257
			public void setDepth(int depth) { /* ignore */}
258
			public void setFieldIndex(int depth){ /* ignore */}
258
			public void setFieldIndex(int depth){ /* ignore */}
259
			public void setUnchecked(boolean isUnchecked) {/* ignore */}
259
			public int sourceStart() { return 0; }
260
			public int sourceStart() { return 0; }
260
			public int sourceEnd() { return 0; }
261
			public int sourceEnd() { return 0; }
261
		};
262
		};
Lines 287-293 Link Here
287
				}
288
				}
288
			}
289
			}
289
			for (int i = 0; i < argumentLength; i++) {
290
			for (int i = 0; i < argumentLength; i++) {
290
				if (originalArgumentTypes[i] != alternateArgumentTypes[i]) {
291
				if (originalArgumentTypes[i] != alternateArgumentTypes[i]
292
                       /*&& !originalArgumentTypes[i].needsUncheckedConversion(alternateArgumentTypes[i])*/) {
291
					scope.problemReporter().unnecessaryCast((CastExpression)arguments[i]);
293
					scope.problemReporter().unnecessaryCast((CastExpression)arguments[i]);
292
				}
294
				}
293
			}
295
			}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java (-1 / +13 lines)
Lines 43-48 Link Here
43
	// record some dependency information for exception types
43
	// record some dependency information for exception types
44
	ReferenceBinding[] thrownExceptions;
44
	ReferenceBinding[] thrownExceptions;
45
	if (((thrownExceptions = this.binding.thrownExceptions).length) != 0) {
45
	if (((thrownExceptions = this.binding.thrownExceptions).length) != 0) {
46
		if ((this.bits & ASTNode.Unchecked) != 0) {
47
			thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.original().thrownExceptions, true, true);
48
		}		
46
		// check exception handling
49
		// check exception handling
47
		flowContext.checkExceptionHandlers(
50
		flowContext.checkExceptionHandlers(
48
			thrownExceptions,
51
			thrownExceptions,
Lines 353-359 Link Here
353
	}
356
	}
354
	if (isMethodUseDeprecated(this.binding, scope, true))
357
	if (isMethodUseDeprecated(this.binding, scope, true))
355
		scope.problemReporter().deprecatedMethod(this.binding, this);
358
		scope.problemReporter().deprecatedMethod(this.binding, this);
356
	checkInvocationArguments(scope, null, allocationType, this.binding, this.arguments, argumentTypes, argsContainCast, this);
359
	checkInvocationArguments(scope, null, allocationType, this.binding, this.arguments, argumentTypes, argsContainCast, this, (this.bits & ASTNode.Unchecked) != 0);
357
	if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) {
360
	if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) {
358
		scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments);
361
		scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments);
359
	}
362
	}
Lines 372-377 Link Here
372
	// ignored
375
	// ignored
373
}
376
}
374
377
378
public void setUnchecked(boolean isUnchecked) {
379
	if (isUnchecked) {
380
		this.bits |= ASTNode.Unchecked;
381
	} else {
382
		this.bits &= ~ASTNode.Unchecked;
383
	}
384
	
385
}
386
375
public void traverse(ASTVisitor visitor, BlockScope scope) {
387
public void traverse(ASTVisitor visitor, BlockScope scope) {
376
	if (visitor.visit(this, scope)) {
388
	if (visitor.visit(this, scope)) {
377
		if (this.typeArguments != null) {
389
		if (this.typeArguments != null) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java (-1 lines)
Lines 93-99 Link Here
93
	}
93
	}
94
94
95
	public TypeBinding resolveForCatch(BlockScope scope) {
95
	public TypeBinding resolveForCatch(BlockScope scope) {
96
97
		// resolution on an argument of a catch clause
96
		// resolution on an argument of a catch clause
98
		// provide the scope with a side effect : insertion of a LOCAL
97
		// provide the scope with a side effect : insertion of a LOCAL
99
		// that represents the argument. The type must be from JavaThrowable
98
		// that represents the argument. The type must be from JavaThrowable
(-)compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java (-5 / +25 lines)
Lines 69-74 Link Here
69
	}
69
	}
70
	ReferenceBinding[] thrownExceptions;
70
	ReferenceBinding[] thrownExceptions;
71
	if ((thrownExceptions = this.binding.thrownExceptions) != Binding.NO_EXCEPTIONS) {
71
	if ((thrownExceptions = this.binding.thrownExceptions) != Binding.NO_EXCEPTIONS) {
72
		if ((this.bits & ASTNode.Unchecked) != 0) {
73
			thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.original().thrownExceptions, true, true);
74
		}
72
		// must verify that exceptions potentially thrown by this expression are caught in the method
75
		// must verify that exceptions potentially thrown by this expression are caught in the method
73
		flowContext.checkExceptionHandlers(thrownExceptions, this, flowInfo.copy(), currentScope);
76
		flowContext.checkExceptionHandlers(thrownExceptions, this, flowInfo.copy(), currentScope);
74
		// TODO (maxime) the copy above is needed because of a side effect into
77
		// TODO (maxime) the copy above is needed because of a side effect into
Lines 394-401 Link Here
394
		scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, argumentTypes);
397
		scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, argumentTypes);
395
		return null;
398
		return null;
396
	}
399
	}
397
	this.binding =
400
	this.binding = this.receiver.isImplicitThis()
398
		this.receiver.isImplicitThis()
399
			? scope.getImplicitMethod(this.selector, argumentTypes, this)
401
			? scope.getImplicitMethod(this.selector, argumentTypes, this)
400
			: scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this);
402
			: scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this);
401
	if (!this.binding.isValidBinding()) {
403
	if (!this.binding.isValidBinding()) {
Lines 466-472 Link Here
466
			scope.problemReporter().indirectAccessToStaticMethod(this, this.binding);
468
			scope.problemReporter().indirectAccessToStaticMethod(this, this.binding);
467
		}
469
		}
468
	}
470
	}
469
	checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this);
471
	checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this, (this.bits & ASTNode.Unchecked) != 0);
470
472
471
	//-------message send that are known to fail at compile time-----------
473
	//-------message send that are known to fail at compile time-----------
472
	if (this.binding.isAbstract()) {
474
	if (this.binding.isAbstract()) {
Lines 482-489 Link Here
482
	if (this.binding == scope.environment().arrayClone && compilerOptions.sourceLevel >= ClassFileConstants.JDK1_5) {
484
	if (this.binding == scope.environment().arrayClone && compilerOptions.sourceLevel >= ClassFileConstants.JDK1_5) {
483
		this.resolvedType = this.actualReceiverType;
485
		this.resolvedType = this.actualReceiverType;
484
	} else {
486
	} else {
485
		TypeBinding returnType = this.binding.returnType;
487
		TypeBinding returnType;
486
		if (returnType != null) returnType = returnType.capture(scope, this.sourceEnd);
488
		if ((this.bits & ASTNode.Unchecked) != 0) {
489
			returnType = this.binding.original().returnType;
490
			if (returnType != null) {
491
				returnType = scope.environment().convertToRawType(returnType.erasure(), true);
492
			}
493
		} else {
494
			returnType = this.binding.returnType;
495
			if (returnType != null) {
496
				returnType = returnType.capture(scope, this.sourceEnd);
497
			}
498
		}
487
		this.resolvedType = returnType;
499
		this.resolvedType = returnType;
488
	}
500
	}
489
	if (this.receiver.isSuper() && compilerOptions.getSeverity(CompilerOptions.OverridingMethodWithoutSuperInvocation) != ProblemSeverities.Ignore) {
501
	if (this.receiver.isSuper() && compilerOptions.getSeverity(CompilerOptions.OverridingMethodWithoutSuperInvocation) != ProblemSeverities.Ignore) {
Lines 527-532 Link Here
527
	// ignore for here
539
	// ignore for here
528
}
540
}
529
541
542
public void setUnchecked(boolean isUnchecked) {
543
	if (isUnchecked) {
544
		this.bits |= ASTNode.Unchecked;
545
	} else {
546
		this.bits &= ~ASTNode.Unchecked;
547
	}
548
}
549
530
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
550
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
531
	if (visitor.visit(this, blockScope)) {
551
	if (visitor.visit(this, blockScope)) {
532
		this.receiver.traverse(visitor, blockScope);
552
		this.receiver.traverse(visitor, blockScope);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java (-1 / +13 lines)
Lines 81-86 Link Here
81
81
82
			ReferenceBinding[] thrownExceptions;
82
			ReferenceBinding[] thrownExceptions;
83
			if ((thrownExceptions = this.binding.thrownExceptions) != Binding.NO_EXCEPTIONS) {
83
			if ((thrownExceptions = this.binding.thrownExceptions) != Binding.NO_EXCEPTIONS) {
84
				if ((this.bits & ASTNode.Unchecked) != 0) {
85
					thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.original().thrownExceptions, true, true);
86
				}				
84
				// check exceptions
87
				// check exceptions
85
				flowContext.checkExceptionHandlers(
88
				flowContext.checkExceptionHandlers(
86
					thrownExceptions,
89
					thrownExceptions,
Lines 397-403 Link Here
397
				if (isMethodUseDeprecated(this.binding, scope, this.accessMode != ExplicitConstructorCall.ImplicitSuper)) {
400
				if (isMethodUseDeprecated(this.binding, scope, this.accessMode != ExplicitConstructorCall.ImplicitSuper)) {
398
					scope.problemReporter().deprecatedMethod(this.binding, this);
401
					scope.problemReporter().deprecatedMethod(this.binding, this);
399
				}
402
				}
400
				checkInvocationArguments(scope, null, receiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this);
403
				checkInvocationArguments(scope, null, receiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this, (this.bits & ASTNode.Unchecked) != 0);
401
				if (this.binding.isPrivate() || receiverType.isLocalType()) {
404
				if (this.binding.isPrivate() || receiverType.isLocalType()) {
402
					this.binding.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
405
					this.binding.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
403
				}
406
				}
Lines 430-435 Link Here
430
		// ignore for here
433
		// ignore for here
431
	}
434
	}
432
435
436
	public void setUnchecked(boolean isUnchecked) {
437
		if (isUnchecked) {
438
			this.bits |= ASTNode.Unchecked;
439
		} else {
440
			this.bits &= ~ASTNode.Unchecked;
441
		}
442
		
443
	}
444
	
433
	public void traverse(ASTVisitor visitor, BlockScope scope) {
445
	public void traverse(ASTVisitor visitor, BlockScope scope) {
434
		if (visitor.visit(this, scope)) {
446
		if (visitor.visit(this, scope)) {
435
			if (this.qualification != null) {
447
			if (this.qualification != null) {
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-15 / +137 lines)
Lines 45-50 Link Here
45
	public int kind;
45
	public int kind;
46
	public Scope parent;
46
	public Scope parent;
47
47
48
	protected Scope(int kind, Scope parent) {
49
		this.kind = kind;
50
		this.parent = parent;
51
	}
52
48
	/* Answer an int describing the relationship between the given types.
53
	/* Answer an int describing the relationship between the given types.
49
	*
54
	*
50
	* 		NOT_RELATED
55
	* 		NOT_RELATED
Lines 59-65 Link Here
59
		return Scope.NOT_RELATED;
64
		return Scope.NOT_RELATED;
60
	}
65
	}
61
66
62
	public static TypeBinding getBaseType(char[] name) {
67
	/**
68
	 * Returns a type where either all variables or specific ones got discarded.
69
	 * e.g. List<E> (discarding <E extends Enum<E>) will return:  List<? extends Enum<?>>
70
	 */
71
	public static TypeBinding convertEliminatingTypeVariables(TypeBinding originalType, ReferenceBinding genericType, int rank, Set eliminatedVariables) {
72
		if ((originalType.tagBits & TagBits.HasTypeVariable) != 0) {
73
			switch (originalType.kind()) {
74
				case Binding.ARRAY_TYPE :
75
					ArrayBinding originalArrayType = (ArrayBinding) originalType;
76
					TypeBinding originalLeafComponentType = originalArrayType.leafComponentType;
77
					TypeBinding substitute = convertEliminatingTypeVariables(originalLeafComponentType, genericType, rank, eliminatedVariables); // substitute could itself be array type
78
					if (substitute != originalLeafComponentType) {
79
						return originalArrayType.environment.createArrayType(substitute.leafComponentType(), substitute.dimensions() + originalArrayType.dimensions());
80
					}
81
					break;
82
				case Binding.PARAMETERIZED_TYPE :
83
					ParameterizedTypeBinding paramType = (ParameterizedTypeBinding) originalType;
84
					ReferenceBinding originalEnclosing = paramType.enclosingType();
85
					ReferenceBinding substitutedEnclosing = originalEnclosing;
86
					if (originalEnclosing != null) {
87
						substitutedEnclosing = (ReferenceBinding) convertEliminatingTypeVariables(originalEnclosing, genericType, rank, eliminatedVariables);
88
					}
89
					TypeBinding[] originalArguments = paramType.arguments;
90
					TypeBinding[] substitutedArguments = originalArguments;
91
					for (int i = 0, length = originalArguments == null ? 0 : originalArguments.length; i < length; i++) {
92
						TypeBinding originalArgument = originalArguments[i];
93
						TypeBinding substitutedArgument = convertEliminatingTypeVariables(originalArgument, paramType.genericType(), i, eliminatedVariables);
94
						if (substitutedArgument != originalArgument) {
95
							if (substitutedArguments == originalArguments) {
96
								System.arraycopy(originalArguments, 0, substitutedArguments = new TypeBinding[length], 0, i);
97
							}
98
							substitutedArguments[i] = substitutedArgument;
99
						} else 	if (substitutedArguments != originalArguments) {
100
							substitutedArguments[i] = originalArgument;
101
						}
102
					}
103
					if (originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments) {
104
						return paramType.environment.createParameterizedType(paramType.genericType(), substitutedArguments, substitutedEnclosing);
105
					}
106
					break;
107
				case Binding.TYPE_PARAMETER :
108
					if (genericType == null) {
109
						break;
110
					}
111
					TypeVariableBinding originalVariable = (TypeVariableBinding) originalType;
112
					if (eliminatedVariables != null && eliminatedVariables.contains(originalType)) {
113
						return originalVariable.environment.createWildcard(genericType, rank, null, null, Wildcard.UNBOUND);
114
					}
115
					TypeBinding originalUpperBound = originalVariable.upperBound();
116
					if (eliminatedVariables == null) {
117
						eliminatedVariables = new HashSet(2);
118
					}
119
					eliminatedVariables.add(originalVariable);
120
					TypeBinding substitutedUpperBound = convertEliminatingTypeVariables(originalUpperBound, genericType, rank, eliminatedVariables);
121
					eliminatedVariables.remove(originalVariable);
122
					return originalVariable.environment.createWildcard(genericType, rank, substitutedUpperBound, null, Wildcard.EXTENDS);
123
				case Binding.RAW_TYPE :
124
					break;
125
				case Binding.GENERIC_TYPE :
126
					ReferenceBinding currentType = (ReferenceBinding) originalType;
127
					originalEnclosing = currentType.enclosingType();
128
					substitutedEnclosing = originalEnclosing;
129
					if (originalEnclosing != null) {
130
						substitutedEnclosing = (ReferenceBinding) convertEliminatingTypeVariables(originalEnclosing, genericType, rank, eliminatedVariables);
131
					}
132
					originalArguments = currentType.typeVariables();
133
					substitutedArguments = originalArguments;
134
					for (int i = 0, length = originalArguments == null ? 0 : originalArguments.length; i < length; i++) {
135
						TypeBinding originalArgument = originalArguments[i];
136
						TypeBinding substitutedArgument = convertEliminatingTypeVariables(originalArgument, currentType, i, eliminatedVariables);
137
						if (substitutedArgument != originalArgument) {
138
							if (substitutedArguments == originalArguments) {
139
								System.arraycopy(originalArguments, 0, substitutedArguments = new TypeBinding[length], 0, i);
140
							}
141
							substitutedArguments[i] = substitutedArgument;
142
						} else 	if (substitutedArguments != originalArguments) {
143
							substitutedArguments[i] = originalArgument;
144
						}
145
					}
146
					if (originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments) {
147
						return ((TypeVariableBinding)originalArguments[0]).environment.createParameterizedType(genericType, substitutedArguments, substitutedEnclosing);
148
					}
149
					break;
150
				case Binding.WILDCARD_TYPE :
151
					WildcardBinding wildcard = (WildcardBinding) originalType;
152
					TypeBinding originalBound = wildcard.bound;
153
					TypeBinding substitutedBound = originalBound;
154
					if (originalBound != null) {
155
						substitutedBound = convertEliminatingTypeVariables(originalBound, genericType, rank, eliminatedVariables);
156
						if (substitutedBound != originalBound) {
157
							return wildcard.environment.createWildcard(wildcard.genericType, wildcard.rank, substitutedBound, null, wildcard.boundKind);
158
						}
159
					}
160
					break;
161
				case Binding.INTERSECTION_TYPE :
162
					WildcardBinding intersection = (WildcardBinding) originalType;
163
					originalBound = intersection.bound;
164
					substitutedBound = originalBound;
165
					if (originalBound != null) {
166
						substitutedBound = convertEliminatingTypeVariables(originalBound, genericType, rank, eliminatedVariables);
167
					}
168
					TypeBinding[] originalOtherBounds = intersection.otherBounds;
169
					TypeBinding[] substitutedOtherBounds = originalOtherBounds;
170
					for (int i = 0, length = originalOtherBounds == null ? 0 : originalOtherBounds.length; i < length; i++) {
171
						TypeBinding originalOtherBound = originalOtherBounds[i];
172
						TypeBinding substitutedOtherBound = convertEliminatingTypeVariables(originalOtherBound, genericType, rank, eliminatedVariables);
173
						if (substitutedOtherBound != originalOtherBound) {
174
							if (substitutedOtherBounds == originalOtherBounds) {
175
								System.arraycopy(originalOtherBounds, 0, substitutedOtherBounds = new TypeBinding[length], 0, i);
176
							}
177
							substitutedOtherBounds[i] = substitutedOtherBound;
178
						} else 	if (substitutedOtherBounds != originalOtherBounds) {
179
							substitutedOtherBounds[i] = originalOtherBound;
180
						}
181
					}
182
					if (substitutedBound != originalBound || substitutedOtherBounds != originalOtherBounds) {
183
						return intersection.environment.createWildcard(intersection.genericType, intersection.rank, substitutedBound, substitutedOtherBounds, intersection.boundKind);
184
					}
185
					break;
186
				}
187
		}
188
		return originalType;
189
	}	
190
191
   public static TypeBinding getBaseType(char[] name) {
63
		// list should be optimized (with most often used first)
192
		// list should be optimized (with most often used first)
64
		int length = name.length;
193
		int length = name.length;
65
		if (length > 2 && length < 8) {
194
		if (length > 2 && length < 8) {
Lines 121-127 Link Here
121
		return null;
250
		return null;
122
	}
251
	}
123
252
124
   // 5.1.10
253
	// 5.1.10
125
	public static ReferenceBinding[] greaterLowerBound(ReferenceBinding[] types) {
254
	public static ReferenceBinding[] greaterLowerBound(ReferenceBinding[] types) {
126
		if (types == null) return null;
255
		if (types == null) return null;
127
		int length = types.length;
256
		int length = types.length;
Lines 335-345 Link Here
335
	    return substitutedTypes;
464
	    return substitutedTypes;
336
	}
465
	}
337
466
338
	protected Scope(int kind, Scope parent) {
339
		this.kind = kind;
340
		this.parent = parent;
341
	}
342
343
	/*
467
	/*
344
	 * Boxing primitive
468
	 * Boxing primitive
345
	 */
469
	 */
Lines 587-593 Link Here
587
		int count = 0;
711
		int count = 0;
588
		for (int i = 0; i < length; i++) {
712
		for (int i = 0; i < length; i++) {
589
			TypeParameter typeParameter = typeParameters[i];
713
			TypeParameter typeParameter = typeParameters[i];
590
			TypeVariableBinding parameterBinding = new TypeVariableBinding(typeParameter.name, declaringElement, i);
714
			TypeVariableBinding parameterBinding = new TypeVariableBinding(typeParameter.name, declaringElement, i, environment());
591
			parameterBinding.fPackage = unitPackage;
715
			parameterBinding.fPackage = unitPackage;
592
			typeParameter.binding = parameterBinding;
716
			typeParameter.binding = parameterBinding;
593
717
Lines 2665-2680 Link Here
2665
						// <T extends X<Object>> void foo(T t) {}
2789
						// <T extends X<Object>> void foo(T t) {}
2666
						// foo(T) will show up as foo(Y#RAW) and not foo(X#RAW)
2790
						// foo(T) will show up as foo(Y#RAW) and not foo(X#RAW)
2667
						// Y#RAW is not more specific than a rawified X<T>
2791
						// Y#RAW is not more specific than a rawified X<T>
2668
						if (oneParam == one.original().parameters[i]
2792
						if (twoParam.leafComponentType().erasure() != two.original().parameters[i].leafComponentType().erasure())
2669
								&&  twoParam.leafComponentType().erasure() != two.original().parameters[i].leafComponentType().erasure()) {
2670
							return false;
2793
							return false;
2671
						}
2672
					}
2794
					}
2673
				} else if (oneParam.isCompatibleWith(twoParam)) {
2795
				} else if (oneParam.isCompatibleWith(twoParam)) {
2674
					if (oneParam.leafComponentType().isRawType()) {
2796
					if (oneParam.leafComponentType().isRawType()) {
2675
						// A#RAW is not more specific than a rawified A<T>
2797
						 if (oneParam.needsUncheckedConversion(twoParam))
2676
						if (oneParam.needsUncheckedConversion(two.declaringClass.isRawType() ? twoParam : two.original().parameters[i]))
2798
							 if (oneParam.leafComponentType().erasure() != twoParam.leafComponentType().erasure())
2677
							return false;
2799
								 return false;
2678
					}
2800
					}
2679
				} else {
2801
				} else {
2680
					if (i == oneParamsLength - 1 && one.isVarargs() && two.isVarargs()) {
2802
					if (i == oneParamsLength - 1 && one.isVarargs() && two.isVarargs()) {
Lines 2704-2710 Link Here
2704
		}
2826
		}
2705
		return false;
2827
		return false;
2706
	}
2828
	}
2707
2829
	
2708
	public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) {
2830
	public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) {
2709
		LookupEnvironment environment = environment();
2831
		LookupEnvironment environment = environment();
2710
		if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType())
2832
		if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType())
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java (-21 / +21 lines)
Lines 32-53 Link Here
32
	public ReferenceBinding superclass;
32
	public ReferenceBinding superclass;
33
	public ReferenceBinding[] superInterfaces;
33
	public ReferenceBinding[] superInterfaces;
34
	public char[] genericTypeSignature;
34
	public char[] genericTypeSignature;
35
35
	LookupEnvironment environment;
36
	public TypeVariableBinding(char[] sourceName, Binding declaringElement, int rank) {
36
	
37
	public TypeVariableBinding(char[] sourceName, Binding declaringElement, int rank, LookupEnvironment environment) {
37
		this.sourceName = sourceName;
38
		this.sourceName = sourceName;
38
		this.declaringElement = declaringElement;
39
		this.declaringElement = declaringElement;
39
		this.rank = rank;
40
		this.rank = rank;
40
		this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat type var as public
41
		this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat type var as public
41
		this.tagBits |= TagBits.HasTypeVariable;
42
		this.tagBits |= TagBits.HasTypeVariable;
43
		this.environment = environment;
42
	}
44
	}
43
45
44
	/**
46
	/**
45
	 * Returns true if the argument type satisfies all bounds of the type parameter
47
	 * Returns true if the argument type satisfies all bounds of the type parameter
46
	 */
48
	 */
47
	public int boundCheck(Substitution substitution, TypeBinding argumentType) {
49
	public int boundCheck(Substitution substitution, TypeBinding argumentType) {
48
50
		if (argumentType == TypeBinding.NULL || argumentType == this) {
49
		if (argumentType == TypeBinding.NULL || argumentType == this)
50
			return TypeConstants.OK;
51
			return TypeConstants.OK;
52
		}
51
		boolean hasSubstitution = substitution != null;
53
		boolean hasSubstitution = substitution != null;
52
		if (!(argumentType instanceof ReferenceBinding || argumentType.isArrayType()))
54
		if (!(argumentType instanceof ReferenceBinding || argumentType.isArrayType()))
53
			return TypeConstants.MISMATCH;
55
			return TypeConstants.MISMATCH;
Lines 63-89 Link Here
63
					TypeBinding wildcardBound = wildcard.bound;
65
					TypeBinding wildcardBound = wildcard.bound;
64
					if (wildcardBound == this)
66
					if (wildcardBound == this)
65
						return TypeConstants.OK;
67
						return TypeConstants.OK;
66
					ReferenceBinding superclassBound = hasSubstitution ? (ReferenceBinding)Scope.substitute(substitution, this.superclass) : this.superclass;
67
					boolean isArrayBound = wildcardBound.isArrayType();
68
					boolean isArrayBound = wildcardBound.isArrayType();
68
					if (!wildcardBound.isInterface()) {
69
					if (!wildcardBound.isInterface()) {
69
						if (superclassBound.id != TypeIds.T_JavaLangObject) {
70
						TypeBinding substitutedSuperType = hasSubstitution ? Scope.substitute(substitution, this.superclass) : this.superclass;
71
						if (substitutedSuperType.id != TypeIds.T_JavaLangObject) {
70
							if (isArrayBound) {
72
							if (isArrayBound) {
71
								if (!wildcardBound.isCompatibleWith(superclassBound))
73
								if (!wildcardBound.isCompatibleWith(substitutedSuperType))
72
									return TypeConstants.MISMATCH;
74
									return TypeConstants.MISMATCH;
73
							} else {
75
							} else {
74
								TypeBinding match = wildcardBound.findSuperTypeOriginatingFrom(superclassBound);
76
								TypeBinding match = wildcardBound.findSuperTypeOriginatingFrom(substitutedSuperType);
75
								if (match != null) {
77
								if (match != null) {
76
									if (superclassBound.isProvablyDistinct(match)) {
78
									if (substitutedSuperType.isProvablyDistinct(match)) {
77
										return TypeConstants.MISMATCH;
79
										return TypeConstants.MISMATCH;
78
									}
80
									}
79
								} else {
81
								} else {
80
									match =  superclassBound.findSuperTypeOriginatingFrom(wildcardBound);
82
									match =  substitutedSuperType.findSuperTypeOriginatingFrom(wildcardBound);
81
									if (match != null) {
83
									if (match != null) {
82
										if (match.isProvablyDistinct(wildcardBound)) {
84
										if (match.isProvablyDistinct(wildcardBound)) {
83
											return TypeConstants.MISMATCH;
85
											return TypeConstants.MISMATCH;
84
										}
86
										}
85
									} else {
87
									} else {
86
										if (!wildcardBound.isTypeVariable() && !superclassBound.isTypeVariable()) {
88
										if (!wildcardBound.isTypeVariable() && !substitutedSuperType.isTypeVariable()) {
87
											return TypeConstants.MISMATCH;
89
											return TypeConstants.MISMATCH;
88
										}
90
										}
89
									}
91
									}
Lines 91-108 Link Here
91
							}
93
							}
92
						}
94
						}
93
					}
95
					}
94
					ReferenceBinding[] superInterfaceBounds = hasSubstitution ? Scope.substitute(substitution, this.superInterfaces) : this.superInterfaces;
95
					int length = superInterfaceBounds.length;
96
					boolean mustImplement = isArrayBound || ((ReferenceBinding)wildcardBound).isFinal();
96
					boolean mustImplement = isArrayBound || ((ReferenceBinding)wildcardBound).isFinal();
97
					for (int i = 0; i < length; i++) {
97
					for (int i = 0, length = this.superInterfaces.length; i < length; i++) {
98
						TypeBinding superInterfaceBound = superInterfaceBounds[i];
98
						TypeBinding substitutedSuperType = hasSubstitution ? Scope.substitute(substitution, this.superInterfaces[i]) : this.superInterfaces[i];
99
						if (isArrayBound) {
99
						if (isArrayBound) {
100
							if (!wildcardBound.isCompatibleWith(superInterfaceBound))
100
							if (!wildcardBound.isCompatibleWith(substitutedSuperType))
101
									return TypeConstants.MISMATCH;
101
									return TypeConstants.MISMATCH;
102
						} else {
102
						} else {
103
							TypeBinding match = wildcardBound.findSuperTypeOriginatingFrom(superInterfaceBound);
103
							TypeBinding match = wildcardBound.findSuperTypeOriginatingFrom(substitutedSuperType);
104
							if (match != null) {
104
							if (match != null) {
105
								if (superInterfaceBound.isProvablyDistinct(match)) {
105
								if (substitutedSuperType.isProvablyDistinct(match)) {
106
									return TypeConstants.MISMATCH;
106
									return TypeConstants.MISMATCH;
107
								}
107
								}
108
							} else if (mustImplement) {
108
							} else if (mustImplement) {
Lines 380-398 Link Here
380
    public char[] readableName() {
380
    public char[] readableName() {
381
        return this.sourceName;
381
        return this.sourceName;
382
    }
382
    }
383
	ReferenceBinding resolve(LookupEnvironment environment) {
383
	ReferenceBinding resolve() {
384
		if ((this.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0)
384
		if ((this.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0)
385
			return this;
385
			return this;
386
386
387
		TypeBinding oldSuperclass = this.superclass, oldFirstInterface = null;
387
		TypeBinding oldSuperclass = this.superclass, oldFirstInterface = null;
388
		if (this.superclass != null)
388
		if (this.superclass != null)
389
			this.superclass = (ReferenceBinding) BinaryTypeBinding.resolveType(this.superclass, environment, true /* raw conversion */);
389
			this.superclass = (ReferenceBinding) BinaryTypeBinding.resolveType(this.superclass, this.environment, true /* raw conversion */);
390
		ReferenceBinding[] interfaces = this.superInterfaces;
390
		ReferenceBinding[] interfaces = this.superInterfaces;
391
		int length;
391
		int length;
392
		if ((length = interfaces.length) != 0) {
392
		if ((length = interfaces.length) != 0) {
393
			oldFirstInterface = interfaces[0];
393
			oldFirstInterface = interfaces[0];
394
			for (int i = length; --i >= 0;) {
394
			for (int i = length; --i >= 0;) {
395
				interfaces[i] = (ReferenceBinding) BinaryTypeBinding.resolveType(interfaces[i], environment, true /* raw conversion */);
395
				interfaces[i] = (ReferenceBinding) BinaryTypeBinding.resolveType(interfaces[i], this.environment, true /* raw conversion */);
396
			}
396
			}
397
		}
397
		}
398
		// refresh the firstBound in case it changed
398
		// refresh the firstBound in case it changed
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java (-122 / +24 lines)
Lines 11-19 Link Here
11
package org.eclipse.jdt.internal.compiler.lookup;
11
package org.eclipse.jdt.internal.compiler.lookup;
12
12
13
import java.util.HashMap;
13
import java.util.HashMap;
14
import java.util.HashSet;
15
import java.util.Map;
14
import java.util.Map;
16
import java.util.Set;
17
15
18
import org.eclipse.jdt.core.compiler.CharOperation;
16
import org.eclipse.jdt.core.compiler.CharOperation;
19
import org.eclipse.jdt.internal.compiler.ClassFilePool;
17
import org.eclipse.jdt.internal.compiler.ClassFilePool;
Lines 386-508 Link Here
386
	return packageBinding;
384
	return packageBinding;
387
}
385
}
388
386
389
public TypeBinding convertEliminatingTypeVariables(TypeBinding originalType, ReferenceBinding genericType, int rank, Set eliminatedVariables) {
390
	if ((originalType.tagBits & TagBits.HasTypeVariable) != 0) {
391
		switch (originalType.kind()) {
392
			case Binding.ARRAY_TYPE :
393
				ArrayBinding originalArrayType = (ArrayBinding) originalType;
394
				TypeBinding originalLeafComponentType = originalArrayType.leafComponentType;
395
				TypeBinding substitute = convertEliminatingTypeVariables(originalLeafComponentType, genericType, rank, eliminatedVariables); // substitute could itself be array type
396
				if (substitute != originalLeafComponentType) {
397
					return createArrayType(substitute.leafComponentType(), substitute.dimensions() + originalArrayType.dimensions());
398
				}
399
				break;
400
			case Binding.PARAMETERIZED_TYPE :
401
				ParameterizedTypeBinding paramType = (ParameterizedTypeBinding) originalType;
402
				ReferenceBinding originalEnclosing = paramType.enclosingType();
403
				ReferenceBinding substitutedEnclosing = originalEnclosing;
404
				if (originalEnclosing != null) {
405
					substitutedEnclosing = (ReferenceBinding) convertEliminatingTypeVariables(originalEnclosing, genericType, rank, eliminatedVariables);
406
				}
407
				TypeBinding[] originalArguments = paramType.arguments;
408
				TypeBinding[] substitutedArguments = originalArguments;
409
				for (int i = 0, length = originalArguments == null ? 0 : originalArguments.length; i < length; i++) {
410
					TypeBinding originalArgument = originalArguments[i];
411
					TypeBinding substitutedArgument = convertEliminatingTypeVariables(originalArgument, paramType.genericType(), i, eliminatedVariables);
412
					if (substitutedArgument != originalArgument) {
413
						if (substitutedArguments == originalArguments) {
414
							System.arraycopy(originalArguments, 0, substitutedArguments = new TypeBinding[length], 0, i);
415
						}
416
						substitutedArguments[i] = substitutedArgument;
417
					} else 	if (substitutedArguments != originalArguments) {
418
						substitutedArguments[i] = originalArgument;
419
					}
420
				}
421
				if (originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments) {
422
					return createParameterizedType(paramType.genericType(), substitutedArguments, substitutedEnclosing);
423
				}
424
				break;
425
			case Binding.TYPE_PARAMETER :
426
				if (eliminatedVariables != null && eliminatedVariables.contains(originalType)) {
427
					return createWildcard(genericType, rank, null, null, Wildcard.UNBOUND);
428
				}
429
				TypeVariableBinding variable = (TypeVariableBinding) originalType;
430
				TypeBinding originalUpperBound = variable.upperBound();
431
				if (eliminatedVariables == null) {
432
					eliminatedVariables = new HashSet(2);
433
				}
434
				eliminatedVariables.add(variable);
435
				TypeBinding substitutedUpperBound = convertEliminatingTypeVariables(originalUpperBound, genericType, rank, eliminatedVariables);
436
				eliminatedVariables.remove(variable);
437
				return createWildcard(genericType, rank, substitutedUpperBound, null, Wildcard.EXTENDS);
438
			case Binding.RAW_TYPE :
439
				break;
440
			case Binding.GENERIC_TYPE :
441
				ReferenceBinding currentType = (ReferenceBinding) originalType;
442
				originalEnclosing = currentType.enclosingType();
443
				substitutedEnclosing = originalEnclosing;
444
				if (originalEnclosing != null) {
445
					substitutedEnclosing = (ReferenceBinding) convertEliminatingTypeVariables(originalEnclosing, genericType, rank, eliminatedVariables);
446
				}
447
				originalArguments = currentType.typeVariables();
448
				substitutedArguments = originalArguments;
449
				for (int i = 0, length = originalArguments == null ? 0 : originalArguments.length; i < length; i++) {
450
					TypeBinding originalArgument = originalArguments[i];
451
					TypeBinding substitutedArgument = convertEliminatingTypeVariables(originalArgument, currentType, i, eliminatedVariables);
452
					if (substitutedArgument != originalArgument) {
453
						if (substitutedArguments == originalArguments) {
454
							System.arraycopy(originalArguments, 0, substitutedArguments = new TypeBinding[length], 0, i);
455
						}
456
						substitutedArguments[i] = substitutedArgument;
457
					} else 	if (substitutedArguments != originalArguments) {
458
						substitutedArguments[i] = originalArgument;
459
					}
460
				}
461
				if (originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments) {
462
					return createParameterizedType(genericType, substitutedArguments, substitutedEnclosing);
463
				}
464
				break;
465
			case Binding.WILDCARD_TYPE :
466
				WildcardBinding wildcard = (WildcardBinding) originalType;
467
				TypeBinding originalBound = wildcard.bound;
468
				TypeBinding substitutedBound = originalBound;
469
				if (originalBound != null) {
470
					substitutedBound = convertEliminatingTypeVariables(originalBound, genericType, rank, eliminatedVariables);
471
					if (substitutedBound != originalBound) {
472
						return createWildcard(wildcard.genericType, wildcard.rank, substitutedBound, null, wildcard.boundKind);
473
					}
474
				}
475
				break;
476
			case Binding.INTERSECTION_TYPE :
477
				WildcardBinding intersection = (WildcardBinding) originalType;
478
				originalBound = intersection.bound;
479
				substitutedBound = originalBound;
480
				if (originalBound != null) {
481
					substitutedBound = convertEliminatingTypeVariables(originalBound, genericType, rank, eliminatedVariables);
482
				}
483
				TypeBinding[] originalOtherBounds = intersection.otherBounds;
484
				TypeBinding[] substitutedOtherBounds = originalOtherBounds;
485
				for (int i = 0, length = originalOtherBounds == null ? 0 : originalOtherBounds.length; i < length; i++) {
486
					TypeBinding originalOtherBound = originalOtherBounds[i];
487
					TypeBinding substitutedOtherBound = convertEliminatingTypeVariables(originalOtherBound, genericType, rank, eliminatedVariables);
488
					if (substitutedOtherBound != originalOtherBound) {
489
						if (substitutedOtherBounds == originalOtherBounds) {
490
							System.arraycopy(originalOtherBounds, 0, substitutedOtherBounds = new TypeBinding[length], 0, i);
491
						}
492
						substitutedOtherBounds[i] = substitutedOtherBound;
493
					} else 	if (substitutedOtherBounds != originalOtherBounds) {
494
						substitutedOtherBounds[i] = originalOtherBound;
495
					}
496
				}
497
				if (substitutedBound != originalBound || substitutedOtherBounds != originalOtherBounds) {
498
					return createWildcard(intersection.genericType, intersection.rank, substitutedBound, substitutedOtherBounds, intersection.boundKind);
499
				}
500
				break;
501
			}
502
	}
503
	return originalType;
504
}
505
506
/**
387
/**
507
 * Convert a given source type into a parameterized form if generic.
388
 * Convert a given source type into a parameterized form if generic.
508
 * generic X<E> --> param X<E>
389
 * generic X<E> --> param X<E>
Lines 598-603 Link Here
598
	return type;
479
	return type;
599
}
480
}
600
481
482
/**
483
 * Convert an array of types in raw forms.
484
 * Only allocate an array if anything is different.
485
 */
486
public ReferenceBinding[] convertToRawTypes(ReferenceBinding[] originalTypes, boolean forceErasure, boolean forceRawEnclosingType) {
487
	if (originalTypes == null) return null;
488
    ReferenceBinding[] convertedTypes = originalTypes;
489
    for (int i = 0, length = originalTypes.length; i < length; i++) {
490
        ReferenceBinding originalType = originalTypes[i];
491
        ReferenceBinding convertedType = (ReferenceBinding) convertToRawType(forceErasure ? originalType.erasure() : originalType, forceRawEnclosingType);
492
        if (convertedType != originalType) {        
493
            if (convertedTypes == originalTypes) {
494
                System.arraycopy(originalTypes, 0, convertedTypes = new ReferenceBinding[length], 0, i);
495
            }
496
            convertedTypes[i] = convertedType;
497
        } else if (convertedTypes != originalTypes) {
498
            convertedTypes[i] = originalType;
499
        }
500
    }
501
    return convertedTypes;
502
}
601
503
602
// variation for unresolved types in binaries (consider generic type as raw)
504
// variation for unresolved types in binaries (consider generic type as raw)
603
public TypeBinding convertUnresolvedBinaryToRawType(TypeBinding type) {
505
public TypeBinding convertUnresolvedBinaryToRawType(TypeBinding type) {
Lines 657-663 Link Here
657
	}
559
	}
658
	return type;
560
	return type;
659
}
561
}
660
661
/*
562
/*
662
 *  Used to guarantee annotation identity.
563
 *  Used to guarantee annotation identity.
663
 */
564
 */
Lines 667-672 Link Here
667
	}
568
	}
668
	return new AnnotationBinding(annotationType, pairs);
569
	return new AnnotationBinding(annotationType, pairs);
669
}
570
}
571
670
/*
572
/*
671
 *  Used to guarantee array type identity.
573
 *  Used to guarantee array type identity.
672
 */
574
 */
Lines 708-717 Link Here
708
	this.uniqueArrayBindings[dimIndex] = arrayBindings;
610
	this.uniqueArrayBindings[dimIndex] = arrayBindings;
709
	return arrayBindings[length] = new ArrayBinding(leafComponentType, dimensionCount, this);
611
	return arrayBindings[length] = new ArrayBinding(leafComponentType, dimensionCount, this);
710
}
612
}
711
712
public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
613
public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
713
	return createBinaryTypeFrom(binaryType, packageBinding, true, accessRestriction);
614
	return createBinaryTypeFrom(binaryType, packageBinding, true, accessRestriction);
714
}
615
}
616
715
public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, boolean needFieldsAndMethods, AccessRestriction accessRestriction) {
617
public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, boolean needFieldsAndMethods, AccessRestriction accessRestriction) {
716
	BinaryTypeBinding binaryBinding = new BinaryTypeBinding(packageBinding, binaryType, this);
618
	BinaryTypeBinding binaryBinding = new BinaryTypeBinding(packageBinding, binaryType, this);
717
619
Lines 1342-1348 Link Here
1342
		return this.nameEnvironment.isPackage(null, name);
1244
		return this.nameEnvironment.isPackage(null, name);
1343
	return this.nameEnvironment.isPackage(compoundName, name);
1245
	return this.nameEnvironment.isPackage(compoundName, name);
1344
}
1246
}
1345
1346
// The method verifier is lazily initialized to guarantee the receiver, the compiler & the oracle are ready.
1247
// The method verifier is lazily initialized to guarantee the receiver, the compiler & the oracle are ready.
1347
public MethodVerifier methodVerifier() {
1248
public MethodVerifier methodVerifier() {
1348
	if (this.verifier == null)
1249
	if (this.verifier == null)
Lines 1351-1356 Link Here
1351
			: new MethodVerifier15(this); // covariance only if sourceLevel is >= 1.5
1252
			: new MethodVerifier15(this); // covariance only if sourceLevel is >= 1.5
1352
	return this.verifier;
1253
	return this.verifier;
1353
}
1254
}
1255
1354
public void releaseClassFiles(org.eclipse.jdt.internal.compiler.ClassFile[] classFiles) {
1256
public void releaseClassFiles(org.eclipse.jdt.internal.compiler.ClassFile[] classFiles) {
1355
	for (int i = 0, fileCount = classFiles.length; i < fileCount; i++)
1257
	for (int i = 0, fileCount = classFiles.length; i < fileCount; i++)
1356
		this.classFilePool.release(classFiles[i]);
1258
		this.classFilePool.release(classFiles[i]);
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.java (-14 / +1 lines)
Lines 21-29 Link Here
21
	int status;
21
	int status;
22
	TypeBinding expectedType;
22
	TypeBinding expectedType;
23
	boolean hasExplicitExpectedType; // indicates whether the expectedType (if set) was explicit in code, or set by default
23
	boolean hasExplicitExpectedType; // indicates whether the expectedType (if set) was explicit in code, or set by default
24
    public boolean isUnchecked;
24
	TypeBinding[] substitutes;
25
	TypeBinding[] substitutes;
25
	final static int FAILED = 1;
26
	final static int FAILED = 1;
26
	final static int RAW_SUBSTITUTION = 2;
27
27
28
public InferenceContext(MethodBinding genericMethod) {
28
public InferenceContext(MethodBinding genericMethod) {
29
	this.genericMethod = genericMethod;
29
	this.genericMethod = genericMethod;
Lines 33-48 Link Here
33
	this.substitutes = new TypeBinding[varLength];
33
	this.substitutes = new TypeBinding[varLength];
34
}
34
}
35
35
36
public boolean checkRawSubstitution() {
37
	// only at first level, during inference from arguments
38
	if (this.depth > 0) return false;
39
//	if (this.argumentIndex < 0 || this.depth != 0) {
40
//		return false;
41
//	}
42
	this.status = RAW_SUBSTITUTION;
43
	return true;
44
}
45
46
public TypeBinding[] getSubstitutes(TypeVariableBinding typeVariable, int constraint) {
36
public TypeBinding[] getSubstitutes(TypeVariableBinding typeVariable, int constraint) {
47
	return this.collectedSubstitutes[typeVariable.rank][constraint];
37
	return this.collectedSubstitutes[typeVariable.rank][constraint];
48
}
38
}
Lines 99-107 Link Here
99
		case FAILED :
89
		case FAILED :
100
			buffer.append("failed]");//$NON-NLS-1$
90
			buffer.append("failed]");//$NON-NLS-1$
101
			break;
91
			break;
102
		case RAW_SUBSTITUTION :
103
			buffer.append("raw-subst]");//$NON-NLS-1$
104
			break;
105
	}
92
	}
106
	if (this.expectedType == null) {
93
	if (this.expectedType == null) {
107
		buffer.append(" [expectedType=null]"); //$NON-NLS-1$
94
		buffer.append(" [expectedType=null]"); //$NON-NLS-1$
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java (-1 lines)
Lines 53-59 Link Here
53
	* Answer the receiver's binding type from Binding.BindingID.
53
	* Answer the receiver's binding type from Binding.BindingID.
54
	*/
54
	*/
55
	public final int kind() {
55
	public final int kind() {
56
57
		return LOCAL;
56
		return LOCAL;
58
	}
57
	}
59
58
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java (-2 / +2 lines)
Lines 724-730 Link Here
724
			}
724
			}
725
			if (variable.firstBound == null) // unbound variable
725
			if (variable.firstBound == null) // unbound variable
726
				return false;
726
				return false;
727
			TypeBinding eliminatedType = (paramType.environment.convertEliminatingTypeVariables(variable, paramType.genericType(), rank, null));
727
			TypeBinding eliminatedType = Scope.convertEliminatingTypeVariables(variable, paramType.genericType(), rank, null);
728
			switch (eliminatedType.kind()) {
728
			switch (eliminatedType.kind()) {
729
				case Binding.WILDCARD_TYPE :
729
				case Binding.WILDCARD_TYPE :
730
				case Binding.INTERSECTION_TYPE :
730
				case Binding.INTERSECTION_TYPE :
Lines 779-785 Link Here
779
			}
779
			}
780
			if (otherVariable.firstBound == null) // unbound variable
780
			if (otherVariable.firstBound == null) // unbound variable
781
				return false;
781
				return false;
782
			TypeBinding otherEliminatedType = (paramType.environment.convertEliminatingTypeVariables(otherVariable, paramType.genericType(), rank, null));
782
			TypeBinding otherEliminatedType = Scope.convertEliminatingTypeVariables(otherVariable, paramType.genericType(), rank, null);
783
			switch (otherEliminatedType.kind()) {
783
			switch (otherEliminatedType.kind()) {
784
				case Binding.WILDCARD_TYPE :
784
				case Binding.WILDCARD_TYPE :
785
				case Binding.INTERSECTION_TYPE :
785
				case Binding.INTERSECTION_TYPE :
(-)eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java (+4 lines)
Lines 55-59 Link Here
55
	// ignored
55
	// ignored
56
}
56
}
57
57
58
public void setUnchecked(boolean isUnchecked) {
59
	// ignored
60
}
61
58
}
62
}
59
63
(-)eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java (-2 / +9 lines)
Lines 11-16 Link Here
11
package org.eclipse.jdt.internal.eval;
11
package org.eclipse.jdt.internal.eval;
12
12
13
import org.eclipse.jdt.core.compiler.CharOperation;
13
import org.eclipse.jdt.core.compiler.CharOperation;
14
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
14
import org.eclipse.jdt.internal.compiler.ast.CastExpression;
15
import org.eclipse.jdt.internal.compiler.ast.CastExpression;
15
import org.eclipse.jdt.internal.compiler.ast.Expression;
16
import org.eclipse.jdt.internal.compiler.ast.Expression;
16
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
17
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
Lines 311-317 Link Here
311
			}			
312
			}			
312
		}
313
		}
313
	}
314
	}
314
	checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this);
315
	checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this, (this.bits & ASTNode.Unchecked) != 0);
315
316
316
	//-------message send that are known to fail at compile time-----------
317
	//-------message send that are known to fail at compile time-----------
317
	if (this.binding.isAbstract()) {
318
	if (this.binding.isAbstract()) {
Lines 331-337 Link Here
331
		this.resolvedType = this.actualReceiverType;
332
		this.resolvedType = this.actualReceiverType;
332
	} else {
333
	} else {
333
		TypeBinding returnType = this.binding.returnType;
334
		TypeBinding returnType = this.binding.returnType;
334
		if (returnType != null) returnType = returnType.capture(scope, this.sourceEnd);
335
		
336
		if (returnType != null) {
337
			if ((this.bits & ASTNode.Unchecked) != 0) {
338
				returnType = scope.environment().convertToRawType(returnType.erasure(), true);
339
			}
340
			returnType = returnType.capture(scope, this.sourceEnd);			
341
		}
335
		this.resolvedType = returnType;
342
		this.resolvedType = returnType;
336
	}
343
	}
337
	return this.resolvedType;
344
	return this.resolvedType;
(-)eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java (-1 / +14 lines)
Lines 41-46 Link Here
41
		this.evaluationContext = evaluationContext;
41
		this.evaluationContext = evaluationContext;
42
		this.isImplicit = isImplicit;
42
		this.isImplicit = isImplicit;
43
	}
43
	}
44
	
44
	public boolean checkAccess(MethodScope methodScope) {
45
	public boolean checkAccess(MethodScope methodScope) {
45
		// this/super cannot be used in constructor call
46
		// this/super cannot be used in constructor call
46
		if (this.evaluationContext.isConstructorCall) {
47
		if (this.evaluationContext.isConstructorCall) {
Lines 55-60 Link Here
55
		}
56
		}
56
		return true;
57
		return true;
57
	}
58
	}
59
	
58
	public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
60
	public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
59
		int pc = codeStream.position;
61
		int pc = codeStream.position;
60
		if (valueRequired) {
62
		if (valueRequired) {
Lines 63-80 Link Here
63
		}
65
		}
64
		codeStream.recordPositionsFrom(pc, this.sourceStart);
66
		codeStream.recordPositionsFrom(pc, this.sourceStart);
65
	}
67
	}
68
	
66
	/**
69
	/**
67
	 * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#genericTypeArguments()
70
	 * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#genericTypeArguments()
68
	 */
71
	 */
69
	public TypeBinding[] genericTypeArguments() {
72
	public TypeBinding[] genericTypeArguments() {
70
		return null;
73
		return null;
71
	}
74
	}
75
	
72
	public boolean isSuperAccess(){
76
	public boolean isSuperAccess(){
73
		return false;
77
		return false;
74
	}
78
	}
79
	
75
	public boolean isTypeAccess(){
80
	public boolean isTypeAccess(){
76
		return false;
81
		return false;
77
	}
82
	}
83
	
78
	public StringBuffer printExpression(int indent, StringBuffer output){
84
	public StringBuffer printExpression(int indent, StringBuffer output){
79
85
80
		char[] declaringType = this.evaluationContext.declaringTypeName;
86
		char[] declaringType = this.evaluationContext.declaringTypeName;
Lines 85-92 Link Here
85
			output.append(declaringType);
91
			output.append(declaringType);
86
		return output.append(")this"); //$NON-NLS-1$
92
		return output.append(")this"); //$NON-NLS-1$
87
	}
93
	}
94
	
88
	public TypeBinding resolveType(BlockScope scope) {
95
	public TypeBinding resolveType(BlockScope scope) {
89
90
		// implicit this
96
		// implicit this
91
		this.constant = Constant.NotAConstant;
97
		this.constant = Constant.NotAConstant;
92
		TypeBinding snippetType = null;
98
		TypeBinding snippetType = null;
Lines 105-117 Link Here
105
		}
111
		}
106
		return this.resolvedType = this.delegateThis.type;
112
		return this.resolvedType = this.delegateThis.type;
107
	}
113
	}
114
	
108
	public void setActualReceiverType(ReferenceBinding receiverType) {
115
	public void setActualReceiverType(ReferenceBinding receiverType) {
109
		// ignored
116
		// ignored
110
	}
117
	}
118
	
111
	public void setDepth(int depth){
119
	public void setDepth(int depth){
112
		// ignored
120
		// ignored
113
	}
121
	}
122
	
114
	public void setFieldIndex(int index){
123
	public void setFieldIndex(int index){
115
		// ignored
124
		// ignored
116
	}
125
	}
126
	
127
	public void setUnchecked(boolean isUnchecked) {
128
		// ignored
129
	}	
117
}
130
}
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-9 / +91 lines)
Lines 21-35 Link Here
21
import org.eclipse.jdt.core.compiler.CharOperation;
21
import org.eclipse.jdt.core.compiler.CharOperation;
22
import org.eclipse.jdt.core.compiler.IProblem;
22
import org.eclipse.jdt.core.compiler.IProblem;
23
import org.eclipse.jdt.core.compiler.InvalidInputException;
23
import org.eclipse.jdt.core.compiler.InvalidInputException;
24
import org.eclipse.jdt.internal.compiler.*;
24
import org.eclipse.jdt.internal.compiler.CompilationResult;
25
import org.eclipse.jdt.internal.compiler.ast.*;
25
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
26
import org.eclipse.jdt.internal.compiler.IProblemFactory;
27
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
28
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
29
import org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration;
30
import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
31
import org.eclipse.jdt.internal.compiler.ast.Annotation;
32
import org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration;
33
import org.eclipse.jdt.internal.compiler.ast.Argument;
34
import org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression;
35
import org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference;
36
import org.eclipse.jdt.internal.compiler.ast.ArrayReference;
37
import org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference;
38
import org.eclipse.jdt.internal.compiler.ast.Assignment;
39
import org.eclipse.jdt.internal.compiler.ast.BinaryExpression;
40
import org.eclipse.jdt.internal.compiler.ast.Block;
41
import org.eclipse.jdt.internal.compiler.ast.BranchStatement;
42
import org.eclipse.jdt.internal.compiler.ast.CaseStatement;
43
import org.eclipse.jdt.internal.compiler.ast.CastExpression;
44
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
45
import org.eclipse.jdt.internal.compiler.ast.CompoundAssignment;
46
import org.eclipse.jdt.internal.compiler.ast.ConditionalExpression;
47
import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
48
import org.eclipse.jdt.internal.compiler.ast.EqualExpression;
49
import org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
50
import org.eclipse.jdt.internal.compiler.ast.Expression;
51
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
52
import org.eclipse.jdt.internal.compiler.ast.FieldReference;
53
import org.eclipse.jdt.internal.compiler.ast.ImportReference;
54
import org.eclipse.jdt.internal.compiler.ast.Initializer;
55
import org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression;
56
import org.eclipse.jdt.internal.compiler.ast.IntLiteral;
57
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement;
58
import org.eclipse.jdt.internal.compiler.ast.Literal;
59
import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
60
import org.eclipse.jdt.internal.compiler.ast.LongLiteral;
61
import org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
62
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
63
import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
64
import org.eclipse.jdt.internal.compiler.ast.NameReference;
65
import org.eclipse.jdt.internal.compiler.ast.NumberLiteral;
66
import org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference;
67
import org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
68
import org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression;
69
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
70
import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
71
import org.eclipse.jdt.internal.compiler.ast.Reference;
72
import org.eclipse.jdt.internal.compiler.ast.ReturnStatement;
73
import org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
74
import org.eclipse.jdt.internal.compiler.ast.Statement;
75
import org.eclipse.jdt.internal.compiler.ast.SwitchStatement;
76
import org.eclipse.jdt.internal.compiler.ast.ThisReference;
77
import org.eclipse.jdt.internal.compiler.ast.TryStatement;
78
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
79
import org.eclipse.jdt.internal.compiler.ast.TypeParameter;
80
import org.eclipse.jdt.internal.compiler.ast.TypeReference;
81
import org.eclipse.jdt.internal.compiler.ast.UnaryExpression;
82
import org.eclipse.jdt.internal.compiler.ast.Wildcard;
26
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
83
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
27
import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
84
import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
28
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
85
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
29
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
86
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
30
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
87
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
31
import org.eclipse.jdt.internal.compiler.lookup.*;
88
import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
32
import org.eclipse.jdt.internal.compiler.parser.*;
89
import org.eclipse.jdt.internal.compiler.lookup.Binding;
90
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
91
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
92
import org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
93
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
94
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
95
import org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
96
import org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding;
97
import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
98
import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
99
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
100
import org.eclipse.jdt.internal.compiler.lookup.Scope;
101
import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
102
import org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding;
103
import org.eclipse.jdt.internal.compiler.lookup.TagBits;
104
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
105
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
106
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
107
import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
108
import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding;
109
import org.eclipse.jdt.internal.compiler.parser.JavadocTagConstants;
110
import org.eclipse.jdt.internal.compiler.parser.Parser;
111
import org.eclipse.jdt.internal.compiler.parser.RecoveryScanner;
112
import org.eclipse.jdt.internal.compiler.parser.Scanner;
113
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
114
import org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
33
import org.eclipse.jdt.internal.compiler.util.Messages;
115
import org.eclipse.jdt.internal.compiler.util.Messages;
34
116
35
public class ProblemReporter extends ProblemHandler {
117
public class ProblemReporter extends ProblemHandler {
Lines 6828-6834 Link Here
6828
		nodeSourceStart(field,location),
6910
		nodeSourceStart(field,location),
6829
		nodeSourceEnd(field, location));
6911
		nodeSourceEnd(field, location));
6830
}
6912
}
6831
public void unsafeRawGenericMethodInvocation(ASTNode location, MethodBinding rawMethod) {
6913
public void unsafeRawGenericMethodInvocation(ASTNode location, MethodBinding rawMethod, TypeBinding[] argumentTypes) {
6832
	boolean isConstructor = rawMethod.isConstructor();
6914
	boolean isConstructor = rawMethod.isConstructor();
6833
	int severity = computeSeverity(isConstructor ? IProblem.UnsafeRawGenericConstructorInvocation : IProblem.UnsafeRawGenericMethodInvocation);
6915
	int severity = computeSeverity(isConstructor ? IProblem.UnsafeRawGenericConstructorInvocation : IProblem.UnsafeRawGenericMethodInvocation);
6834
	if (severity == ProblemSeverities.Ignore) return;
6916
	if (severity == ProblemSeverities.Ignore) return;
Lines 6839-6851 Link Here
6839
				new String(rawMethod.declaringClass.sourceName()),
6921
				new String(rawMethod.declaringClass.sourceName()),
6840
				typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, false),
6922
				typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, false),
6841
				new String(rawMethod.declaringClass.readableName()),
6923
				new String(rawMethod.declaringClass.readableName()),
6842
				typesAsString(rawMethod.original().isVarargs(), rawMethod.parameters, false),
6924
				typesAsString(rawMethod.original().isVarargs(), argumentTypes, false),
6843
			 },
6925
			 },
6844
			new String[] {
6926
			new String[] {
6845
				new String(rawMethod.declaringClass.sourceName()),
6927
				new String(rawMethod.declaringClass.sourceName()),
6846
				typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, true),
6928
				typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, true),
6847
				new String(rawMethod.declaringClass.shortReadableName()),
6929
				new String(rawMethod.declaringClass.shortReadableName()),
6848
				typesAsString(rawMethod.original().isVarargs(), rawMethod.parameters, true),
6930
				typesAsString(false, argumentTypes, true),
6849
			 },
6931
			 },
6850
			severity,
6932
			severity,
6851
			location.sourceStart,
6933
			location.sourceStart,
Lines 6857-6869 Link Here
6857
				new String(rawMethod.selector),
6939
				new String(rawMethod.selector),
6858
				typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, false),
6940
				typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, false),
6859
				new String(rawMethod.declaringClass.readableName()),
6941
				new String(rawMethod.declaringClass.readableName()),
6860
				typesAsString(rawMethod.original().isVarargs(), rawMethod.parameters, false),
6942
				typesAsString(false, argumentTypes, false),
6861
			 },
6943
			 },
6862
			new String[] {
6944
			new String[] {
6863
				new String(rawMethod.selector),
6945
				new String(rawMethod.selector),
6864
				typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, true),
6946
				typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, true),
6865
				new String(rawMethod.declaringClass.shortReadableName()),
6947
				new String(rawMethod.declaringClass.shortReadableName()),
6866
				typesAsString(rawMethod.original().isVarargs(), rawMethod.parameters, true),
6948
				typesAsString(false, argumentTypes, true),
6867
			 },
6949
			 },
6868
			severity,
6950
			severity,
6869
			location.sourceStart,
6951
			location.sourceStart,
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (+1 lines)
Lines 452-457 Link Here
452
		public void setActualReceiverType(ReferenceBinding receiverType) {/* empty */}
452
		public void setActualReceiverType(ReferenceBinding receiverType) {/* empty */}
453
		public void setDepth(int depth){/* empty */}
453
		public void setDepth(int depth){/* empty */}
454
		public void setFieldIndex(int depth){/* empty */}
454
		public void setFieldIndex(int depth){/* empty */}
455
		public void setUnchecked(boolean isUnchecked) {/* empty */}
455
		public int sourceEnd() { return 0; 	}
456
		public int sourceEnd() { return 0; 	}
456
		public int sourceStart() { return 0; 	}
457
		public int sourceStart() { return 0; 	}
457
	};
458
	};

Return to bug 258798