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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java (-4 / +9 lines)
Lines 253-261 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()) {
257
			if (!receiverType.isEnum()) {
257
			if (this.anonymousType != null) {
258
				scope.problemReporter().anonymousClassCannotExtendFinalClass(type, receiverType);
258
				if (!receiverType.isEnum()) {
259
					scope.problemReporter().anonymousClassCannotExtendFinalClass(type, receiverType);
260
				}
261
			} else if (!receiverType.canBeInstantiated()) {
262
				scope.problemReporter().cannotInstantiate(type, receiverType);
263
				return this.resolvedType = receiverType;
259
			}
264
			}
260
			hasError = true;
265
			hasError = true;
261
		}
266
		}
Lines 290-300 Link Here
290
		if (hasError) return this.resolvedType = receiverType;
295
		if (hasError) return this.resolvedType = receiverType;
291
		if (this.anonymousType == null) {
296
		if (this.anonymousType == null) {
292
			// qualified allocation with no anonymous type
297
			// qualified allocation with no anonymous type
293
			ReferenceBinding allocationType = (ReferenceBinding) receiverType;
294
			if (!receiverType.canBeInstantiated()) {
298
			if (!receiverType.canBeInstantiated()) {
295
				scope.problemReporter().cannotInstantiate(type, receiverType);
299
				scope.problemReporter().cannotInstantiate(type, receiverType);
296
				return this.resolvedType = receiverType;
300
				return this.resolvedType = receiverType;
297
			}
301
			}
302
			ReferenceBinding allocationType = (ReferenceBinding) receiverType;
298
			if ((this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) {
303
			if ((this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) {
299
				if (isMethodUseDeprecated(binding, scope)) {
304
				if (isMethodUseDeprecated(binding, scope)) {
300
					scope.problemReporter().deprecatedMethod(this.binding, this);
305
					scope.problemReporter().deprecatedMethod(this.binding, this);
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java (+4 lines)
Lines 491-496 Link Here
491
					modifiers |= AccAbstract;
491
					modifiers |= AccAbstract;
492
				}
492
				}
493
			}
493
			}
494
			modifiers |= AccFinal;
494
		} else {
495
		} else {
495
			// detect abnormal cases for classes
496
			// detect abnormal cases for classes
496
			if (isMemberType) { // includes member types defined inside local types
497
			if (isMemberType) { // includes member types defined inside local types
Lines 588-593 Link Here
588
		
589
		
589
			// set the modifiers
590
			// set the modifiers
590
			int implicitValue = AccPublic | AccStatic | AccFinal | AccEnum;
591
			int implicitValue = AccPublic | AccStatic | AccFinal | AccEnum;
592
			if (fieldDecl.initialization instanceof QualifiedAllocationExpression) {
593
				declaringClass.modifiers &= ~AccFinal;
594
			}
591
			fieldBinding.modifiers|= implicitValue;
595
			fieldBinding.modifiers|= implicitValue;
592
			return;
596
			return;
593
		}
597
		}

Return to bug 99428