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 207637 Details for
Bug 186342
[compiler][null] Using annotations for null checking
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fix for assumed root cause behind reconciler issue
Bug_186342_c166-2.patch (text/plain), 3.80 KB, created by
Stephan Herrmann
on 2011-11-28 19:49:28 EST
(
hide
)
Description:
fix for assumed root cause behind reconciler issue
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2011-11-28 19:49:28 EST
Size:
3.80 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java >index 45b209a..06438b1 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java >@@ -486,7 +486,7 @@ > "Type mismatch: required \'@NonNull Object\' but the provided value is null\n" + > "----------\n" /* compiler output */); > } >-//null is passed to a non-null parameter in a qualified allocation expression, generic constructor, target class read from .class >+// null is passed to a non-null parameter in a qualified allocation expression, generic constructor, target class read from .class > public void test_nonnull_parameter_012() { > Map customOptions = getCompilerOptions(); > customOptions.put(JavaCore.COMPILER_PB_NULL_SPECIFICATION_INSUFFICIENT_INFO, JavaCore.ERROR); >@@ -2390,4 +2390,36 @@ > }, > ""); > } >+// test analysis disablement, binary type contains annotation >+public void test_disabled_1() { >+ Map customOptions = getCompilerOptions(); >+ customOptions.put(JavaCore.COMPILER_PB_NULL_SPECIFICATION_INSUFFICIENT_INFO, JavaCore.ERROR); >+ runConformTestWithLibs( >+ new String[] { >+ "ContainingInner2.java", >+ "public class ContainingInner2 {\n" + >+ " public ContainingInner2 (@org.eclipse.jdt.annotation.NonNull Object o) {\n" + >+ " }\n" + >+ " public class Inner {\n" + >+ " public <T> Inner (@org.eclipse.jdt.annotation.NonNull T o) {\n" + >+ " }\n" + >+ " }\n" + >+ "}\n", >+ }, >+ null /*customOptions*/, >+ ""); >+ customOptions.put(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.DISABLED); >+ runConformTestWithLibs( >+ false, // flush directory >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " void create() {\n" + >+ " ContainingInner2 container = new ContainingInner2(null);\n" + >+ " ContainingInner2.Inner inner = container.new Inner(null);\n" + >+ " }\n" + >+ "}\n"}, >+ customOptions, >+ "" /* compiler output */); >+} > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >index 63d5fcb..b2240c1 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >@@ -1152,10 +1152,12 @@ > return this.storedAnnotations; > } > void scanMethodForNullAnnotation(IBinaryMethod method, MethodBinding methodBinding) { >+ if (!this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) >+ return; > char[][] nullableAnnotationName = this.environment.getNullableAnnotationName(); > char[][] nonNullAnnotationName = this.environment.getNonNullAnnotationName(); > if (nullableAnnotationName == null || nonNullAnnotationName == null) >- return; // not configured to use null annotations >+ return; // not well-configured to use null annotations > > // return: > IBinaryAnnotation[] annotations = method.getAnnotations(); >@@ -1204,9 +1206,11 @@ > } > } > void scanTypeForNullAnnotation(IBinaryType binaryType) { >+ if (!this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) >+ return; > char[][] nonNullByDefaultAnnotationName = this.environment.getNonNullByDefaultAnnotationName(); > if (nonNullByDefaultAnnotationName == null) >- return; // not configured to use null annotations >+ return; // not well-configured to use null annotations > > IBinaryAnnotation[] annotations = binaryType.getAnnotations(); > if (annotations != null) {
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
Actions:
View
|
Diff
Attachments on
bug 186342
:
74851
|
86246
|
86247
|
89354
|
184335
|
185507
|
186796
|
186798
|
186872
|
186876
|
186889
|
186890
|
206525
|
206557
|
207270
|
207308
|
207478
|
207565
|
207567
|
207573
|
207592
|
207604
|
207635
|
207637
|
207639
|
207657
|
207659
|
207672
|
207677
|
207685