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 209384 Details for
Bug 358903
Filter practically unimportant resource leak warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
incremental changes 3
Bug_358903_v0.9.6-update3.patch (text/plain), 3.07 KB, created by
Stephan Herrmann
on 2012-01-12 10:03:57 EST
(
hide
)
Description:
incremental changes 3
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2012-01-12 10:03:57 EST
Size:
3.07 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java >index ff4c4cf..9ed8c39 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java >@@ -26,7 +26,7 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > public class ResourceLeakTests extends AbstractRegressionTest { > > static { >-// TESTS_NAMES = new String[] { "test061c"}; >+// TESTS_NAMES = new String[] { "test063e"}; > // TESTS_NUMBERS = new int[] { 50 }; > // TESTS_RANGE = new int[] { 11, -1 }; > } >@@ -1838,7 +1838,6 @@ public void test056throw5() { > true, > options); > } >- > // Bug 358903 - Filter practically unimportant resource leak warnings > // Bug 360908 - Avoid resource leak warning when the underlying/chained resource is closed explicitly > // a resource wrapper is not closed but the underlying resource is >@@ -2674,5 +2673,32 @@ public void test063d() throws IOException { > "----------\n", > options); > } >+// Bug 362332 - Only report potential leak when closeable not created in the local scope >+// a resource is obtained from a field read, then re-assigned >+public void test063e() { >+ Map options = getCompilerOptions(); >+ options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR); >+ options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR); >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "import java.io.FileInputStream;\n" + >+ "import java.io.IOException;\n" + >+ "public class X {\n" + >+ " FileInputStream input1;\n" + >+ " public void foo() throws IOException {\n" + >+ " FileInputStream input = input1;\n" + >+ " input = new FileInputStream(\"adfafd\");\n" + >+ " input.close();\n" + >+ " }\n" + >+ "}\n" >+ }, >+ "", >+ null, >+ true, >+ null, >+ options, >+ null); >+} > > } >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 e1330a7..4ec7620 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 >@@ -351,8 +351,7 @@ public class FakedTrackingVariable extends LocalDeclaration { > tracker.globalClosingState |= PASSED_TO_OUTSIDE; > flowInfo.markPotentiallyNullBit(tracker.binding); // shed some doubt > return tracker; >- } else if (expression instanceof FieldReference >- || expression instanceof QualifiedNameReference) >+ } else if ((expression.bits & RestrictiveFlagMASK) == Binding.FIELD) > { > // responsibility for this resource probably lies at a higher level > FakedTrackingVariable tracker = new FakedTrackingVariable(local, location);
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 358903
:
208899
|
209082
|
209107
|
209169
|
209179
|
209232
|
209234
|
209276
|
209373
|
209374
|
209384
|
209409
|
209457
|
209460
|
209464
|
209472
|
209482