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 61788 Details for
Bug 178895
[compiler][null] A for-each loop changes its value on each iterator but the null pointer analysis is not taking that into consideration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix + test case
patch.txt (text/plain), 2.35 KB, created by
Maxime Daniel
on 2007-03-23 04:33:01 EDT
(
hide
)
Description:
Fix + test case
Filename:
MIME Type:
Creator:
Maxime Daniel
Created:
2007-03-23 04:33:01 EDT
Size:
2.35 KB
patch
obsolete
>Index: org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java >=================================================================== >--- org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java (revision 156) >+++ org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java (working copy) >@@ -96,6 +96,7 @@ > continueLabel, scope); > UnconditionalFlowInfo actionInfo = > condInfo.nullInfoLessUnconditionalCopy(); >+ actionInfo.markAsDefinitelyUnknown(this.elementVariable.binding); > FlowInfo exitBranch; > if (!(action == null || (action.isEmptyBlock() > && currentScope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_3))) { >Index: org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java >=================================================================== >--- org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java (revision 156) >+++ org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java (working copy) >@@ -6490,7 +6490,7 @@ > // suggested by https://bugs.eclipse.org/bugs/show_bug.cgi?id=127570 > // the issue is that we cannot do less than full aliasing analysis to > // catch this one >-// TODO (maxime) reconsider when/if we bring full aliasing in >+// PREMATURE (maxime) reconsider when/if we bring full aliasing in > public void _test0738_for_unknown_protection() { > this.runConformTest( > new String[] { >@@ -6515,6 +6515,31 @@ > ""); > } > >+// null analysis -- for >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=178895 >+public void test0739_for() { >+ if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "import java.util.List;\n" + >+ "public class X {\n" + >+ " void foo(List<Object> l, boolean b) {\n" + >+ " for (Object o : l) {\n" + >+ " if (b) {\n" + >+ " if (o != null) {\n" + >+ " return;\n" + >+ " }\n" + >+ " } else {\n" + >+ " o.toString();\n" + >+ " }\n" + >+ " }\n" + >+ " }\n" + >+ "}\n"}, >+ ""); >+ } >+} >+ > // null analysis -- switch > public void test0800_switch() { > this.runConformTest(
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 178895
: 61788