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 212880 Details for
Bug 372319
Unexpected 'The local variable i may not have been initialized' compile error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
improved fix
Bug_372319_v2.patch (text/plain), 3.59 KB, created by
Stephan Herrmann
on 2012-03-19 17:55:10 EDT
(
hide
)
Description:
improved fix
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2012-03-19 17:55:10 EDT
Size:
3.59 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >index ed98d20..d79c747 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >@@ -84,7 +84,7 @@ > } > > // after having analysed exceptions above start tracking newly allocated resource: >- if (FakedTrackingVariable.isAnyCloseable(this.resolvedType) && currentScope.compilerOptions().analyseResourceLeaks) >+ if (currentScope.compilerOptions().analyseResourceLeaks && FakedTrackingVariable.isAnyCloseable(this.resolvedType)) > FakedTrackingVariable.analyseCloseableAllocation(currentScope, flowInfo, this); > > if (this.binding.declaringClass.isMemberType() && !this.binding.declaringClass.isStatic()) { >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java >index 4ac6c2f..88164fd 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java >@@ -528,6 +528,9 @@ > * @return one of the constants FlowInfo.{NULL,POTENTIALLY_NULL,POTENTIALLY_NON_NULL,NON_NULL}. > */ > private int getNullStatusAggressively(LocalVariableBinding local, FlowInfo flowInfo) { >+ if (flowInfo == FlowInfo.DEAD_END) { >+ return FlowInfo.UNKNOWN; >+ } > int reachMode = flowInfo.reachMode(); > int status = 0; > try { >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java >index b2a9b30..3916d6c 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java >@@ -80,8 +80,8 @@ > FlowInfo preInitInfo = null; > boolean shouldAnalyseResource = this.binding != null > && flowInfo.reachMode() == FlowInfo.REACHABLE >- && FakedTrackingVariable.isAnyCloseable(this.initialization.resolvedType) >- && currentScope.compilerOptions().analyseResourceLeaks; >+ && currentScope.compilerOptions().analyseResourceLeaks >+ && FakedTrackingVariable.isAnyCloseable(this.initialization.resolvedType); > if (shouldAnalyseResource) { > preInitInfo = flowInfo.unconditionalCopy(); > // analysis of resource leaks needs additional context while analyzing the RHS: >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >index 64c50b4..ca10adb 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >@@ -116,7 +116,7 @@ > } > > // after having analysed exceptions above start tracking newly allocated resource: >- if (FakedTrackingVariable.isAnyCloseable(this.resolvedType) && currentScope.compilerOptions().analyseResourceLeaks) { >+ if (currentScope.compilerOptions().analyseResourceLeaks && FakedTrackingVariable.isAnyCloseable(this.resolvedType)) { > FakedTrackingVariable.analyseCloseableAllocation(currentScope, flowInfo, this); > } >
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 372319
:
211937
|
212011
|
212154
|
212156
|
212432
|
212620
|
212729
|
212822
|
212874
|
212880
|
212884