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

Collapse All | Expand All

(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java (+8 lines)
Lines 20-25 Link Here
20
 *							bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
20
 *							bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
21
 *     Jesper S Moller <jesper@selskabet.org> - Contributions for
21
 *     Jesper S Moller <jesper@selskabet.org> - Contributions for
22
 *							bug 378674 - "The method can be declared as static" is wrong
22
 *							bug 378674 - "The method can be declared as static" is wrong
23
 *     Till Brychcy - Contributions for
24
 *     						bug 413460 - NonNullByDefault is not inherited to Constructors when accessed via Class File
23
 *******************************************************************************/
25
 *******************************************************************************/
24
package org.eclipse.jdt.internal.compiler.ast;
26
package org.eclipse.jdt.internal.compiler.ast;
25
27
Lines 28-33 Link Here
28
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
30
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
29
import org.eclipse.jdt.internal.compiler.codegen.*;
31
import org.eclipse.jdt.internal.compiler.codegen.*;
30
import org.eclipse.jdt.internal.compiler.flow.*;
32
import org.eclipse.jdt.internal.compiler.flow.*;
33
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
31
import org.eclipse.jdt.internal.compiler.impl.Constant;
34
import org.eclipse.jdt.internal.compiler.impl.Constant;
32
import org.eclipse.jdt.internal.compiler.lookup.*;
35
import org.eclipse.jdt.internal.compiler.lookup.*;
33
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
36
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
Lines 435-440 Link Here
435
	if (!isDiamond && this.resolvedType.isParameterizedTypeWithActualArguments()) {
438
	if (!isDiamond && this.resolvedType.isParameterizedTypeWithActualArguments()) {
436
 		checkTypeArgumentRedundancy((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope);
439
 		checkTypeArgumentRedundancy((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope);
437
 	}
440
 	}
441
	final CompilerOptions compilerOptions = scope.compilerOptions();
442
	if (compilerOptions.isAnnotationBasedNullAnalysisEnabled && (this.binding.tagBits & TagBits.IsNullnessKnown) == 0) {
443
		new ImplicitNullAnnotationVerifier(compilerOptions.inheritNullAnnotations)
444
				.checkImplicitNullAnnotations(this.binding, null/*srcMethod*/, false, scope);
445
	}
438
	return allocationType;
446
	return allocationType;
439
}
447
}
440
448
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java (-1 / +16 lines)
Lines 19-24 Link Here
19
 *								bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
19
 *								bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
20
 *     Jesper S Moller <jesper@selskabet.org> - Contributions for
20
 *     Jesper S Moller <jesper@selskabet.org> - Contributions for
21
 *								bug 378674 - "The method can be declared as static" is wrong
21
 *								bug 378674 - "The method can be declared as static" is wrong
22
 *     Till Brychcy - Contributions for
23
 *     							bug 413460 - NonNullByDefault is not inherited to Constructors when accessed via Class File
22
 ******************************************************************************/
24
 ******************************************************************************/
23
package org.eclipse.jdt.internal.compiler.ast;
25
package org.eclipse.jdt.internal.compiler.ast;
24
26
Lines 28-37 Link Here
28
import org.eclipse.jdt.internal.compiler.codegen.Opcodes;
30
import org.eclipse.jdt.internal.compiler.codegen.Opcodes;
29
import org.eclipse.jdt.internal.compiler.flow.FlowContext;
31
import org.eclipse.jdt.internal.compiler.flow.FlowContext;
30
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
32
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
33
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
31
import org.eclipse.jdt.internal.compiler.impl.Constant;
34
import org.eclipse.jdt.internal.compiler.impl.Constant;
32
import org.eclipse.jdt.internal.compiler.lookup.Binding;
35
import org.eclipse.jdt.internal.compiler.lookup.Binding;
33
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
36
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
34
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
37
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
38
import org.eclipse.jdt.internal.compiler.lookup.ImplicitNullAnnotationVerifier;
35
import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
39
import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
36
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
40
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
37
import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
41
import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
Lines 264-270 Link Here
264
		if (this.anonymousType == null && this.enclosingInstance == null) {
268
		if (this.anonymousType == null && this.enclosingInstance == null) {
265
			return super.resolveType(scope);
269
			return super.resolveType(scope);
266
		}
270
		}
267
271
		TypeBinding result=resolveTypeForQualifiedAllocationExpression(scope);
272
		if(result != null) {
273
			final CompilerOptions compilerOptions = scope.compilerOptions();
274
			if (compilerOptions.isAnnotationBasedNullAnalysisEnabled && (this.binding.tagBits & TagBits.IsNullnessKnown) == 0) {
275
				new ImplicitNullAnnotationVerifier(compilerOptions.inheritNullAnnotations)
276
						.checkImplicitNullAnnotations(this.binding, null/*srcMethod*/, false, scope);
277
			}
278
		}
279
		return result;
280
	}
281
	
282
	private TypeBinding resolveTypeForQualifiedAllocationExpression(BlockScope scope) {
268
		// Propagate the type checking to the arguments, and checks if the constructor is defined.
283
		// Propagate the type checking to the arguments, and checks if the constructor is defined.
269
		// ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
284
		// ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
270
		// ClassInstanceCreationExpression ::= Name '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
285
		// ClassInstanceCreationExpression ::= Name '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt

Return to bug 413460