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 179310 Details for
Bug 325755
[compiler] wrong initialization state after conditional expression
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
additional test
Bug_325755_test3.patch (text/plain), 2.31 KB, created by
Stephan Herrmann
on 2010-09-21 09:16:12 EDT
(
hide
)
Description:
additional test
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2010-09-21 09:16:12 EDT
Size:
2.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java,v >retrieving revision 1.104 >diff -u -r1.104 NullReferenceTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 21 Sep 2010 06:32:48 -0000 1.104 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 21 Sep 2010 13:00:55 -0000 >@@ -5583,6 +5583,43 @@ > JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); > } > >+// null analysis -- try/catch, >+// combines https://bugs.eclipse.org/bugs/show_bug.cgi?id=320170 - [compiler] [null] Whitebox issues in null analysis >+// and https://bugs.eclipse.org/bugs/show_bug.cgi?id=325755 - [compiler] wrong initialization state after conditional expression >+public void test0536_try_catch() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " X() { throw new RuntimeException(); }\n" + >+ " X bar () { return null; }\n" + >+ " void foo(boolean b) {\n" + >+ " X x = new X();\n" + >+ " try {\n" + >+ " x = null;\n" + >+ " x = new X();\n" + // if this throws an exception catch finds x==null >+ " x = bar();\n" + >+ " } catch (Throwable t) {\n" + >+ " X y;" + >+ " if (b)\n" + >+ " y= new X();\n" + >+ " else\n" + >+ " y = x;\n" + >+ " if (y!=null)\n" + // don't complain as redundant >+ " System.out.print(\"nonnull\");\n" + >+ " System.out.print(x.toString());\n" + // complain: x can be null >+ " }\n" + >+ " }\n" + >+ "}\n"}, >+ "----------\n" + >+ "1. ERROR in X.java (at line 17)\n" + >+ " System.out.print(x.toString());\n" + >+ " ^\n" + >+ "Potential null pointer access: The variable x may be null at this location\n" + >+ "----------\n", >+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); >+} >+ > // null analysis -- try/finally > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=320170 - [compiler] [null] Whitebox issues in null analysis > // trigger nullbits 0111 (pot n|nn|un), don't let "definitely unknown" override previous information
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 325755
:
179259
|
179274
|
179283
| 179310