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 36801 Details for
Bug 132974
[compiler] missing error on uninitialized final local
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
HEAD - suggested fix plus test case
org.eclipse.jdt.core_01.txt (text/plain), 2.44 KB, created by
Maxime Daniel
on 2006-03-23 05:54:19 EST
(
hide
)
Description:
HEAD - suggested fix plus test case
Filename:
MIME Type:
Creator:
Maxime Daniel
Created:
2006-03-23 05:54:19 EST
Size:
2.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java,v >retrieving revision 1.48 >diff -u -r1.48 DoStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java 22 Mar 2006 14:37:45 -0000 1.48 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java 23 Mar 2006 10:53:19 -0000 >@@ -110,7 +110,8 @@ > (loopingContext.initsOnBreak.tagBits & > FlowInfo.UNREACHABLE) != 0 ? > loopingContext.initsOnBreak : >- flowInfo.addInitializationsFrom(loopingContext.initsOnBreak), // recover upstream null info >+ flowInfo.unconditionalCopy().addInitializationsFrom(loopingContext.initsOnBreak), >+ // recover upstream null info > isConditionOptimizedTrue, > (condInfo.tagBits & FlowInfo.UNREACHABLE) == 0 ? > flowInfo.addInitializationsFrom(condInfo.initsWhenFalse()) : condInfo, >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java,v >retrieving revision 1.8 >diff -u -r1.8 FlowAnalysisTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java 16 Mar 2006 14:46:49 -0000 1.8 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java 23 Mar 2006 10:53:21 -0000 >@@ -664,6 +664,31 @@ > "The local variable x may not have been initialized\n" + > "----------\n"); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=132974 >+public void test024() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public void foo(boolean b) {\n" + >+ " final Object l;\n" + >+ " do {\n" + >+ " if (b) {\n" + >+ " l = new Object();\n" + >+ " break;\n" + >+ " }\n" + >+ " } while (false);\n" + >+ " l.toString();\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 10)\n" + >+ " l.toString();\n" + >+ " ^\n" + >+ "The local variable l may not have been initialized\n" + >+ "----------\n"); >+} > public static Class testClass() { > return FlowAnalysisTest.class; > }
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 132974
: 36801