Lines 38-44
Link Here
|
38 |
// Static initializer to specify tests subset using TESTS_* static variables |
38 |
// Static initializer to specify tests subset using TESTS_* static variables |
39 |
// All specified tests which does not belong to the class are skipped... |
39 |
// All specified tests which does not belong to the class are skipped... |
40 |
static { |
40 |
static { |
41 |
// TESTS_NAMES = new String[] { "testB11_sh62"}; |
41 |
TESTS_NAMES = new String[] { "testB11_sh95"}; |
42 |
// TESTS_NUMBERS = new int[] { 1459 }; |
42 |
// TESTS_NUMBERS = new int[] { 1459 }; |
43 |
// TESTS_RANGE = new int[] { 1097, -1 }; |
43 |
// TESTS_RANGE = new int[] { 1097, -1 }; |
44 |
} |
44 |
} |
Lines 4252-4257
Link Here
|
4252 |
"----------\n"); |
4252 |
"----------\n"); |
4253 |
} |
4253 |
} |
4254 |
|
4254 |
|
|
|
4255 |
// Bug 350318 - [compiler] Erroneous name clash error in @Override methods |
4256 |
// originally reported by André Lehmann |
4257 |
public void testB11_sh95() { |
4258 |
compileOrder = new String[][] { {"Visitor.java"}, {"Caller.java"}}; |
4259 |
Map options = getCompilerOptions(); |
4260 |
options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); |
4261 |
runTestExpectingWarnings( |
4262 |
new String[] { |
4263 |
"Caller.java", |
4264 |
"\n" + |
4265 |
"public class Caller {\n" + |
4266 |
" private static class VisitorImpl extends VisitorAdapter<Object> {\n" + |
4267 |
" \n" + |
4268 |
" @Override\n" + |
4269 |
" public Parameter1 visit(Long r, Object a) {\n" + |
4270 |
" return null;\n" + |
4271 |
" }\n" + |
4272 |
" \n" + |
4273 |
" @Override\n" + |
4274 |
" public Parameter1 visit(Integer r, Object a) {\n" + |
4275 |
" return null;\n" + |
4276 |
" }\n" + |
4277 |
" \n" + |
4278 |
" @Override\n" + |
4279 |
" public Parameter1 visit(Number r, Object a) {\n" + |
4280 |
" return null;\n" + |
4281 |
" }\n" + |
4282 |
" }\n" + |
4283 |
"\n" + |
4284 |
" private void accept(Visitor<Parameter1, Parameter2> v) {\n" + |
4285 |
" v.visit(1, new Parameter2());\n" + |
4286 |
" }\n" + |
4287 |
" \n" + |
4288 |
" public void start() {\n" + |
4289 |
" }\n" + |
4290 |
"}\n", |
4291 |
"Visitor.java", |
4292 |
"public interface Visitor<R, A> {\n" + |
4293 |
"\n" + |
4294 |
" R visit(Long r, A a);\n" + |
4295 |
"\n" + |
4296 |
" R visit(Integer r, A a);\n" + |
4297 |
"\n" + |
4298 |
" R visit(Number r, A a);\n" + |
4299 |
"}\n" + |
4300 |
"class Parameter1 {\n" + |
4301 |
" \n" + |
4302 |
"}\n" + |
4303 |
"class Parameter2 {\n" + |
4304 |
" \n" + |
4305 |
"}\n" + |
4306 |
"abstract class VisitorAdapter<A> implements Visitor<Parameter1, A> {\n" + |
4307 |
"\n" + |
4308 |
" public Parameter1 visit(Long r, A a) {\n" + |
4309 |
" return null;\n" + |
4310 |
" }\n" + |
4311 |
"\n" + |
4312 |
" public Parameter1 visit(Integer r, A a) {\n" + |
4313 |
" return null;\n" + |
4314 |
" }\n" + |
4315 |
"\n" + |
4316 |
" public Parameter1 visit(Number r, A a) {\n" + |
4317 |
" return null;\n" + |
4318 |
" }\n" + |
4319 |
" \n" + |
4320 |
"}\n" |
4321 |
}, |
4322 |
"----------\n" + |
4323 |
"1. WARNING in Caller.java (at line 3)\n" + |
4324 |
" private static class VisitorImpl extends VisitorAdapter<Object> {\n" + |
4325 |
" ^^^^^^^^^^^\n" + |
4326 |
"The type Caller.VisitorImpl is never used locally\n" + |
4327 |
"----------\n" + |
4328 |
"2. WARNING in Caller.java (at line 21)\n" + |
4329 |
" private void accept(Visitor<Parameter1, Parameter2> v) {\n" + |
4330 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
4331 |
"The method accept(Visitor<Parameter1,Parameter2>) from the type Caller is never used locally\n" + |
4332 |
"----------\n", |
4333 |
options); |
4334 |
} |
4335 |
|
4255 |
// reported by Christine Hundt |
4336 |
// reported by Christine Hundt |
4256 |
// B.1.1-otjld-ju-1 |
4337 |
// B.1.1-otjld-ju-1 |
4257 |
public void testB11_ju1() { |
4338 |
public void testB11_ju1() { |