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 234507 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]
regression test
Bug-413460--test.patch (text/plain), 2.28 KB, created by
Stephan Herrmann
on 2013-08-17 04:53:38 EDT
(
hide
)
Description:
regression test
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2013-08-17 04:53:38 EDT
Size:
2.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >diff --git src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java >index d0f020c..890711f 100644 >--- src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java >+++ src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java >@@ -6229,4 +6229,64 @@ > options, > ""); > } >+ >+public void testBug413460() { >+ runConformTestWithLibs( >+ new String[] { >+ "Class2.java", >+ "\n" + >+ "@org.eclipse.jdt.annotation.NonNullByDefault\n" + >+ "public class Class2 {\n" + >+ " public class Class3 {\n" + >+ " public Class3(String nonNullArg) {\n" + >+ " assert nonNullArg != null;\n" + >+ " }\n" + >+ " }\n" + >+ "\n" + >+ " public Class2(String nonNullArg) {\n" + >+ " assert nonNullArg != null;\n" + >+ " }\n" + >+ "\n" + >+ " public static Class2 create(String nonNullArg) {\n" + >+ " return new Class2(nonNullArg);\n" + >+ " }\n" + >+ "}\n" >+ }, >+ getCompilerOptions(), >+ ""); >+ runNegativeTestWithLibs(false, >+ new String[] { >+ "Class1.java", >+ "public class Class1 {\n" + >+ " public static Class2 works() {\n" + >+ " return Class2.create(null);\n" + >+ " }\n" + >+ "\n" + >+ " public static Class2 bug() {\n" + >+ " return new Class2(null);\n" + >+ " }\n" + >+ "\n" + >+ " public static Class2.Class3 qualifiedbug() {\n" + >+ " return new Class2(\"\").new Class3(null);\n" + >+ " }\n" + >+ "}\n" >+ }, >+ getCompilerOptions(), >+ "----------\n" + >+ "1. ERROR in Class1.java (at line 3)\n" + >+ " return Class2.create(null);\n" + >+ " ^^^^\n" + >+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" + >+ "----------\n" + >+ "2. ERROR in Class1.java (at line 7)\n" + >+ " return new Class2(null);\n" + >+ " ^^^^\n" + >+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" + >+ "----------\n" + >+ "3. ERROR in Class1.java (at line 11)\n" + >+ " return new Class2(\"\").new Class3(null);\n" + >+ " ^^^^\n" + >+ "Null type mismatch: required \'@NonNull String\' but the provided value is null\n" + >+ "----------\n"); >+} > }
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 413460
:
234469
| 234507