Lines 253-262
Link Here
|
253 |
} |
253 |
} |
254 |
if (receiverType == null) { |
254 |
if (receiverType == null) { |
255 |
hasError = true; |
255 |
hasError = true; |
256 |
} else if (((ReferenceBinding) receiverType).isFinal() && this.anonymousType != null) { |
256 |
} else if (((ReferenceBinding) receiverType).isFinal() && this.anonymousType != null && !receiverType.isEnum()) { |
257 |
if (!receiverType.isEnum()) { |
257 |
scope.problemReporter().anonymousClassCannotExtendFinalClass(type, receiverType); |
258 |
scope.problemReporter().anonymousClassCannotExtendFinalClass(type, receiverType); |
|
|
259 |
} |
260 |
hasError = true; |
258 |
hasError = true; |
261 |
} |
259 |
} |
262 |
// resolve type arguments (for generic constructor call) |
260 |
// resolve type arguments (for generic constructor call) |
Lines 290-300
Link Here
|
290 |
if (hasError) return this.resolvedType = receiverType; |
288 |
if (hasError) return this.resolvedType = receiverType; |
291 |
if (this.anonymousType == null) { |
289 |
if (this.anonymousType == null) { |
292 |
// qualified allocation with no anonymous type |
290 |
// qualified allocation with no anonymous type |
293 |
ReferenceBinding allocationType = (ReferenceBinding) receiverType; |
|
|
294 |
if (!receiverType.canBeInstantiated()) { |
291 |
if (!receiverType.canBeInstantiated()) { |
295 |
scope.problemReporter().cannotInstantiate(type, receiverType); |
292 |
scope.problemReporter().cannotInstantiate(type, receiverType); |
296 |
return this.resolvedType = receiverType; |
293 |
return this.resolvedType = receiverType; |
297 |
} |
294 |
} |
|
|
295 |
ReferenceBinding allocationType = (ReferenceBinding) receiverType; |
298 |
if ((this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) { |
296 |
if ((this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) { |
299 |
if (isMethodUseDeprecated(binding, scope)) { |
297 |
if (isMethodUseDeprecated(binding, scope)) { |
300 |
scope.problemReporter().deprecatedMethod(this.binding, this); |
298 |
scope.problemReporter().deprecatedMethod(this.binding, this); |