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 179259 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]
Regression test
patch_325755.txt (text/plain), 1.67 KB, created by
Olivier Thomann
on 2010-09-20 13:24:55 EDT
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-09-20 13:24:55 EDT
Size:
1.67 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.103 >diff -u -r1.103 NullReferenceTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 15 Sep 2010 16:09:09 -0000 1.103 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 20 Sep 2010 17:24:34 -0000 >@@ -13493,4 +13493,34 @@ > null); > } > } >+//null analysis -- conditional expression >+public void testBug325755() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public static Object foo(String s1, String s2) {\n" + >+ " String local1 = s1;\n" + >+ " String local2 = s2;\n" + >+ " \n" + >+ " String local3 = null;\n" + >+ " if (local1 != null && local2 != null)\n" + >+ " local3 = \"\"; //$NON-NLS-1$\n" + >+ " else\n" + >+ " local3 = local1 != null ? local1 : local2;\n" + >+ "\n" + >+ " if (local3 != null)\n" + >+ " return new Integer(local3.length());\n" + >+ " return null;\n" + >+ " }\n" + >+ " \n" + >+ " public static void main(String[] args) {\n" + >+ " System.out.print(foo(null, null));\n" + >+ " System.out.print(foo(\"p1\", null));\n" + >+ " System.out.print(foo(null, \"p2\"));\n" + >+ " System.out.print(foo(\"p1\", \"p2\"));\n" + >+ " }\n" + >+ "}"}, >+ "null220"); >+} > } >\ No newline at end of file
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