Lines 26-32
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
Link Here
|
26 |
public class ResourceLeakTests extends AbstractRegressionTest { |
26 |
public class ResourceLeakTests extends AbstractRegressionTest { |
27 |
|
27 |
|
28 |
static { |
28 |
static { |
29 |
// TESTS_NAMES = new String[] { "test061c"}; |
29 |
// TESTS_NAMES = new String[] { "test063e"}; |
30 |
// TESTS_NUMBERS = new int[] { 50 }; |
30 |
// TESTS_NUMBERS = new int[] { 50 }; |
31 |
// TESTS_RANGE = new int[] { 11, -1 }; |
31 |
// TESTS_RANGE = new int[] { 11, -1 }; |
32 |
} |
32 |
} |
Lines 1838-1844
public void test056throw5() {
Link Here
|
1838 |
true, |
1838 |
true, |
1839 |
options); |
1839 |
options); |
1840 |
} |
1840 |
} |
1841 |
|
|
|
1842 |
// Bug 358903 - Filter practically unimportant resource leak warnings |
1841 |
// Bug 358903 - Filter practically unimportant resource leak warnings |
1843 |
// Bug 360908 - Avoid resource leak warning when the underlying/chained resource is closed explicitly |
1842 |
// Bug 360908 - Avoid resource leak warning when the underlying/chained resource is closed explicitly |
1844 |
// a resource wrapper is not closed but the underlying resource is |
1843 |
// a resource wrapper is not closed but the underlying resource is |
Lines 2674-2678
public void test063d() throws IOException {
Link Here
|
2674 |
"----------\n", |
2673 |
"----------\n", |
2675 |
options); |
2674 |
options); |
2676 |
} |
2675 |
} |
|
|
2676 |
// Bug 362332 - Only report potential leak when closeable not created in the local scope |
2677 |
// a resource is obtained from a field read, then re-assigned |
2678 |
public void test063e() { |
2679 |
Map options = getCompilerOptions(); |
2680 |
options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR); |
2681 |
options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR); |
2682 |
this.runConformTest( |
2683 |
new String[] { |
2684 |
"X.java", |
2685 |
"import java.io.FileInputStream;\n" + |
2686 |
"import java.io.IOException;\n" + |
2687 |
"public class X {\n" + |
2688 |
" FileInputStream input1;\n" + |
2689 |
" public void foo() throws IOException {\n" + |
2690 |
" FileInputStream input = input1;\n" + |
2691 |
" input = new FileInputStream(\"adfafd\");\n" + |
2692 |
" input.close();\n" + |
2693 |
" }\n" + |
2694 |
"}\n" |
2695 |
}, |
2696 |
"", |
2697 |
null, |
2698 |
true, |
2699 |
null, |
2700 |
options, |
2701 |
null); |
2702 |
} |
2677 |
|
2703 |
|
2678 |
} |
2704 |
} |