Lines 27-33
Link Here
|
27 |
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; |
27 |
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; |
28 |
|
28 |
|
29 |
public class FlowAnalysisTest extends AbstractRegressionTest { |
29 |
public class FlowAnalysisTest extends AbstractRegressionTest { |
30 |
|
30 |
static { |
|
|
31 |
// TESTS_NUMBERS = new int[] { 69 }; |
32 |
} |
31 |
public FlowAnalysisTest(String name) { |
33 |
public FlowAnalysisTest(String name) { |
32 |
super(name); |
34 |
super(name); |
33 |
} |
35 |
} |
Lines 2069-2075
Link Here
|
2069 |
true /* shouldFlushOutputDirectory */, |
2071 |
true /* shouldFlushOutputDirectory */, |
2070 |
compilerOptions); |
2072 |
compilerOptions); |
2071 |
} |
2073 |
} |
2072 |
|
|
|
2073 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 |
2074 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 |
2074 |
// warning suppressed |
2075 |
// warning suppressed |
2075 |
public void test065() { |
2076 |
public void test065() { |
Lines 2160-2166
Link Here
|
2160 |
compilerOptions /* customOptions */, |
2161 |
compilerOptions /* customOptions */, |
2161 |
null /* clientRequestor */); |
2162 |
null /* clientRequestor */); |
2162 |
} |
2163 |
} |
2163 |
|
2164 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=236385 |
|
|
2165 |
//anonymous type |
2166 |
public void test069() { |
2167 |
Map compilerOptions = getCompilerOptions(); |
2168 |
compilerOptions.put(CompilerOptions.OPTION_ReportUnusedObjectAllocation, CompilerOptions.ERROR); |
2169 |
runNegativeTest( |
2170 |
new String[] { |
2171 |
"X.java", |
2172 |
"public class X {\n" + |
2173 |
" boolean bar() { return false; } \n" + |
2174 |
" public void foo() {" + |
2175 |
" if (bar())\n" + |
2176 |
" new Object() {};\n" + |
2177 |
" }\n" + |
2178 |
"}", |
2179 |
}, |
2180 |
"----------\n" + |
2181 |
"1. ERROR in X.java (at line 4)\n" + |
2182 |
" new Object() {};\n" + |
2183 |
" ^^^^^^^^^^^^^^^\n" + |
2184 |
"The allocated object is never used\n" + |
2185 |
"----------\n", |
2186 |
null /* classLibraries */, |
2187 |
true /* shouldFlushOutputDirectory */, |
2188 |
compilerOptions); |
2189 |
} |
2164 |
public static Class testClass() { |
2190 |
public static Class testClass() { |
2165 |
return FlowAnalysisTest.class; |
2191 |
return FlowAnalysisTest.class; |
2166 |
} |
2192 |
} |