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 150909 Details for
Bug 291418
Missing "redundant null check" warning in foreach.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
test highlighting all problems
nullRef.txt (text/plain), 2.12 KB, created by
Ayushman Jain
on 2009-10-30 05:57:16 EDT
(
hide
)
Description:
test highlighting all problems
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2009-10-30 05:57:16 EDT
Size:
2.12 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.81 >diff -u -r1.81 NullReferenceTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 27 Aug 2009 15:26:58 -0000 1.81 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 30 Oct 2009 09:44:52 -0000 >@@ -10130,4 +10130,38 @@ > "Potential null pointer access: The variable o1 may be null at this location\n" + > "----------\n"); > } >+public void testBug291418() { >+ if (this.complianceLevel >= ClassFileConstants.JDK1_5) { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "class X {\n" + >+ " void foo(int[] argArray) {\n" + >+ " int[] array = {2};\n" + >+ " int[] collectionVar = {1,2};\n" + >+ " if(argArray == null) return;" + >+ " for(int x:collectionVar) {\n" + >+ " if (collectionVar == null);\n" + // collectionVar cannot be null here >+ " if (array == null);\n" + //array is not null here >+ " if (argArray == null);\n" + //argArray cannot be null here >+ " }\n" + >+ " int count = 0;\n" + >+ " do {\n" + >+ " count++;\n" + >+ " if (array == null);\n" + //array is not null here >+ " if (argArray == null);\n" + //argArray cannot be null here >+ " } while (count<10);\n" + >+ " for (int i=0; i<2; i++) {\n" + >+ " if (array == null);\n" + //array is not null here >+ " if (argArray == null);\n" + //argArray cannot be null here >+ " }\n" + >+ " while (true) {\n" + >+ " if (array == null);\n" + //array is not null here >+ " if (argArray == null);\n" + //argArray cannot be null here >+ " }\n" + >+ " }\n" + >+ "}"}, >+ ""); >+ } >+} > } >\ 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 291418
: 150909 |
151153
|
151789