Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 234469 Details for
Bug 413460
NonNullByDefault is not inherited to Constructors when accessed via Class File
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed bugfix
413460.patch (text/plain), 4.76 KB, created by
Till Brychcy
on 2013-08-15 16:16:42 EDT
(
hide
)
Description:
proposed bugfix
Filename:
MIME Type:
Creator:
Till Brychcy
Created:
2013-08-15 16:16:42 EDT
Size:
4.76 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >index 2f4b127..96db07e 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >@@ -20,6 +20,8 @@ > * bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking > * Jesper S Moller <jesper@selskabet.org> - Contributions for > * bug 378674 - "The method can be declared as static" is wrong >+ * Till Brychcy - Contributions for >+ * bug 413460 - NonNullByDefault is not inherited to Constructors when accessed via Class File > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >@@ -28,6 +30,7 @@ > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.codegen.*; > import org.eclipse.jdt.internal.compiler.flow.*; >+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.eclipse.jdt.internal.compiler.impl.Constant; > import org.eclipse.jdt.internal.compiler.lookup.*; > import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; >@@ -435,6 +438,11 @@ > if (!isDiamond && this.resolvedType.isParameterizedTypeWithActualArguments()) { > checkTypeArgumentRedundancy((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope); > } >+ final CompilerOptions compilerOptions = scope.compilerOptions(); >+ if (compilerOptions.isAnnotationBasedNullAnalysisEnabled && (this.binding.tagBits & TagBits.IsNullnessKnown) == 0) { >+ new ImplicitNullAnnotationVerifier(compilerOptions.inheritNullAnnotations) >+ .checkImplicitNullAnnotations(this.binding, null/*srcMethod*/, false, scope); >+ } > return allocationType; > } > >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >index 0f117bf..e351b7d 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >@@ -19,6 +19,8 @@ > * bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking > * Jesper S Moller <jesper@selskabet.org> - Contributions for > * bug 378674 - "The method can be declared as static" is wrong >+ * Till Brychcy - Contributions for >+ * bug 413460 - NonNullByDefault is not inherited to Constructors when accessed via Class File > ******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >@@ -28,10 +30,12 @@ > import org.eclipse.jdt.internal.compiler.codegen.Opcodes; > import org.eclipse.jdt.internal.compiler.flow.FlowContext; > import org.eclipse.jdt.internal.compiler.flow.FlowInfo; >+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.eclipse.jdt.internal.compiler.impl.Constant; > import org.eclipse.jdt.internal.compiler.lookup.Binding; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers; >+import org.eclipse.jdt.internal.compiler.lookup.ImplicitNullAnnotationVerifier; > import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; >@@ -264,7 +268,18 @@ > if (this.anonymousType == null && this.enclosingInstance == null) { > return super.resolveType(scope); > } >- >+ TypeBinding result=resolveTypeForQualifiedAllocationExpression(scope); >+ if(result != null) { >+ final CompilerOptions compilerOptions = scope.compilerOptions(); >+ if (compilerOptions.isAnnotationBasedNullAnalysisEnabled && (this.binding.tagBits & TagBits.IsNullnessKnown) == 0) { >+ new ImplicitNullAnnotationVerifier(compilerOptions.inheritNullAnnotations) >+ .checkImplicitNullAnnotations(this.binding, null/*srcMethod*/, false, scope); >+ } >+ } >+ return result; >+ } >+ >+ private TypeBinding resolveTypeForQualifiedAllocationExpression(BlockScope scope) { > // Propagate the type checking to the arguments, and checks if the constructor is defined. > // ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt > // ClassInstanceCreationExpression ::= Name '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
stephan.herrmann
:
review+
Actions:
View
|
Diff
Attachments on
bug 413460
: 234469 |
234507