Lines 357-362
Link Here
|
357 |
options, |
357 |
options, |
358 |
null); |
358 |
null); |
359 |
} |
359 |
} |
|
|
360 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=118217 |
361 |
public void test016() { |
362 |
Map options = getCompilerOptions(); |
363 |
options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED); |
364 |
options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); |
365 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenDocumented, CompilerOptions.DISABLED); |
366 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED); |
367 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED); |
368 |
this.runNegativeTest( |
369 |
new String[] { |
370 |
"X.java", |
371 |
"public class X extends Parent implements Doable {\n" + |
372 |
" /**\n" + |
373 |
" * @param value\n" + |
374 |
" */\n" + |
375 |
" void foo(int value) { // X#foo(...)\n" + |
376 |
" }\n" + |
377 |
" void bar(int value) { // X#bar(...)\n" + |
378 |
" }\n" + |
379 |
"\n" + |
380 |
" void top(int value) { /* X#top(...)*/}\n" + |
381 |
" void parent(int value) { /* X#parent(...) */}\n" + |
382 |
" public void doit(int value) { /* X#doit(...) */}\n" + |
383 |
"}\n" + |
384 |
"abstract class Top {\n" + |
385 |
" /**\n" + |
386 |
" * @param value\n" + |
387 |
" */\n" + |
388 |
" abstract void top(int value); // Top#top(...)\n" + |
389 |
"}\n" + |
390 |
"abstract class Parent extends Top {\n" + |
391 |
" /**\n" + |
392 |
" * @param value\n" + |
393 |
" */\n" + |
394 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
395 |
"}\n" + |
396 |
"interface Doable {\n" + |
397 |
" /**\n" + |
398 |
" * @param value\n" + |
399 |
" */\n" + |
400 |
" void doit (int value); // Doable#doit(...)\n" + |
401 |
"}", // ================= |
402 |
}, |
403 |
"----------\n" + |
404 |
"1. ERROR in X.java (at line 7)\n" + |
405 |
" void bar(int value) { // X#bar(...)\n" + |
406 |
" ^^^^^\n" + |
407 |
"The parameter value is never read\n" + |
408 |
"----------\n", |
409 |
null /* classLib */, |
410 |
true /* shouldFlushOutputDirectory */, |
411 |
options); |
412 |
} |
413 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=118217 - variation |
414 |
public void test017() { |
415 |
Map options = getCompilerOptions(); |
416 |
options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.DISABLED); |
417 |
options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); |
418 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenDocumented, CompilerOptions.DISABLED); |
419 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED); |
420 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED); |
421 |
this.runNegativeTest( |
422 |
new String[] { |
423 |
"X.java", |
424 |
"public class X extends Parent implements Doable {\n" + |
425 |
" /**\n" + |
426 |
" * @param value\n" + |
427 |
" */\n" + |
428 |
" void foo(int value) { // X#foo(...)\n" + |
429 |
" }\n" + |
430 |
" void bar(int value) { // X#bar(...)\n" + |
431 |
" }\n" + |
432 |
"\n" + |
433 |
" void top(int value) { /* X#top(...)*/}\n" + |
434 |
" void parent(int value) { /* X#parent(...) */}\n" + |
435 |
" public void doit(int value) { /* X#doit(...) */}\n" + |
436 |
"}\n" + |
437 |
"abstract class Top {\n" + |
438 |
" /**\n" + |
439 |
" * @param value\n" + |
440 |
" */\n" + |
441 |
" abstract void top(int value); // Top#top(...)\n" + |
442 |
"}\n" + |
443 |
"abstract class Parent extends Top {\n" + |
444 |
" /**\n" + |
445 |
" * @param value\n" + |
446 |
" */\n" + |
447 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
448 |
"}\n" + |
449 |
"interface Doable {\n" + |
450 |
" /**\n" + |
451 |
" * @param value\n" + |
452 |
" */\n" + |
453 |
" void doit (int value); // Doable#doit(...)\n" + |
454 |
"}", // ================= |
455 |
}, |
456 |
"----------\n" + |
457 |
"1. ERROR in X.java (at line 5)\n" + |
458 |
" void foo(int value) { // X#foo(...)\n" + |
459 |
" ^^^^^\n" + |
460 |
"The parameter value is never read\n" + |
461 |
"----------\n" + |
462 |
"2. ERROR in X.java (at line 7)\n" + |
463 |
" void bar(int value) { // X#bar(...)\n" + |
464 |
" ^^^^^\n" + |
465 |
"The parameter value is never read\n" + |
466 |
"----------\n" + |
467 |
"3. ERROR in X.java (at line 24)\n" + |
468 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
469 |
" ^^^^^\n" + |
470 |
"The parameter value is never read\n" + |
471 |
"----------\n", |
472 |
null /* classLib */, |
473 |
true /* shouldFlushOutputDirectory */, |
474 |
options); |
475 |
} |
476 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=118217 - variation |
477 |
public void test018() { |
478 |
Map options = getCompilerOptions(); |
479 |
options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED); |
480 |
options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); |
481 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenDocumented, CompilerOptions.ENABLED); |
482 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED); |
483 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED); |
484 |
this.runNegativeTest( |
485 |
new String[] { |
486 |
"X.java", |
487 |
"public class X extends Parent implements Doable {\n" + |
488 |
" /**\n" + |
489 |
" * @param value\n" + |
490 |
" */\n" + |
491 |
" void foo(int value) { // X#foo(...)\n" + |
492 |
" }\n" + |
493 |
" void bar(int value) { // X#bar(...)\n" + |
494 |
" }\n" + |
495 |
"\n" + |
496 |
" void top(int value) { /* X#top(...)*/}\n" + |
497 |
" void parent(int value) { /* X#parent(...) */}\n" + |
498 |
" public void doit(int value) { /* X#doit(...) */}\n" + |
499 |
"}\n" + |
500 |
"abstract class Top {\n" + |
501 |
" /**\n" + |
502 |
" * @param value\n" + |
503 |
" */\n" + |
504 |
" abstract void top(int value); // Top#top(...)\n" + |
505 |
"}\n" + |
506 |
"abstract class Parent extends Top {\n" + |
507 |
" /**\n" + |
508 |
" * @param value\n" + |
509 |
" */\n" + |
510 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
511 |
"}\n" + |
512 |
"interface Doable {\n" + |
513 |
" /**\n" + |
514 |
" * @param value\n" + |
515 |
" */\n" + |
516 |
" void doit (int value); // Doable#doit(...)\n" + |
517 |
"}", // ================= |
518 |
}, |
519 |
"----------\n" + |
520 |
"1. ERROR in X.java (at line 5)\n" + |
521 |
" void foo(int value) { // X#foo(...)\n" + |
522 |
" ^^^^^\n" + |
523 |
"The parameter value is never read\n" + |
524 |
"----------\n" + |
525 |
"2. ERROR in X.java (at line 7)\n" + |
526 |
" void bar(int value) { // X#bar(...)\n" + |
527 |
" ^^^^^\n" + |
528 |
"The parameter value is never read\n" + |
529 |
"----------\n" + |
530 |
"3. ERROR in X.java (at line 24)\n" + |
531 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
532 |
" ^^^^^\n" + |
533 |
"The parameter value is never read\n" + |
534 |
"----------\n", |
535 |
null /* classLib */, |
536 |
true /* shouldFlushOutputDirectory */, |
537 |
options); |
538 |
} |
539 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=118217 - variation |
540 |
public void test019() { |
541 |
Map options = getCompilerOptions(); |
542 |
options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED); |
543 |
options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); |
544 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenDocumented, CompilerOptions.ENABLED); |
545 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.ENABLED); |
546 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.ENABLED); |
547 |
this.runNegativeTest( |
548 |
new String[] { |
549 |
"X.java", |
550 |
"public class X extends Parent implements Doable {\n" + |
551 |
" /**\n" + |
552 |
" * @param value\n" + |
553 |
" */\n" + |
554 |
" void foo(int value) { // X#foo(...)\n" + |
555 |
" }\n" + |
556 |
" void bar(int value) { // X#bar(...)\n" + |
557 |
" }\n" + |
558 |
"\n" + |
559 |
" void top(int value) { /* X#top(...)*/}\n" + |
560 |
" void parent(int value) { /* X#parent(...) */}\n" + |
561 |
" public void doit(int value) { /* X#doit(...) */}\n" + |
562 |
"}\n" + |
563 |
"abstract class Top {\n" + |
564 |
" /**\n" + |
565 |
" * @param value\n" + |
566 |
" */\n" + |
567 |
" abstract void top(int value); // Top#top(...)\n" + |
568 |
"}\n" + |
569 |
"abstract class Parent extends Top {\n" + |
570 |
" /**\n" + |
571 |
" * @param value\n" + |
572 |
" */\n" + |
573 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
574 |
"}\n" + |
575 |
"interface Doable {\n" + |
576 |
" /**\n" + |
577 |
" * @param value\n" + |
578 |
" */\n" + |
579 |
" void doit (int value); // Doable#doit(...)\n" + |
580 |
"}", // ================= |
581 |
}, |
582 |
"----------\n" + |
583 |
"1. ERROR in X.java (at line 5)\n" + |
584 |
" void foo(int value) { // X#foo(...)\n" + |
585 |
" ^^^^^\n" + |
586 |
"The parameter value is never read\n" + |
587 |
"----------\n" + |
588 |
"2. ERROR in X.java (at line 7)\n" + |
589 |
" void bar(int value) { // X#bar(...)\n" + |
590 |
" ^^^^^\n" + |
591 |
"The parameter value is never read\n" + |
592 |
"----------\n" + |
593 |
"3. ERROR in X.java (at line 10)\n" + |
594 |
" void top(int value) { /* X#top(...)*/}\n" + |
595 |
" ^^^^^\n" + |
596 |
"The parameter value is never read\n" + |
597 |
"----------\n" + |
598 |
"4. ERROR in X.java (at line 11)\n" + |
599 |
" void parent(int value) { /* X#parent(...) */}\n" + |
600 |
" ^^^^^\n" + |
601 |
"The parameter value is never read\n" + |
602 |
"----------\n" + |
603 |
"5. ERROR in X.java (at line 12)\n" + |
604 |
" public void doit(int value) { /* X#doit(...) */}\n" + |
605 |
" ^^^^^\n" + |
606 |
"The parameter value is never read\n" + |
607 |
"----------\n" + |
608 |
"6. ERROR in X.java (at line 24)\n" + |
609 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
610 |
" ^^^^^\n" + |
611 |
"The parameter value is never read\n" + |
612 |
"----------\n", |
613 |
null /* classLib */, |
614 |
true /* shouldFlushOutputDirectory */, |
615 |
options); |
616 |
} |
617 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=118217 - variation |
618 |
public void test020() { |
619 |
Map options = getCompilerOptions(); |
620 |
options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED); |
621 |
options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); |
622 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenDocumented, CompilerOptions.ENABLED); |
623 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.ENABLED); |
624 |
options.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.ENABLED); |
625 |
this.runNegativeTest( |
626 |
new String[] { |
627 |
"X.java", |
628 |
"public class X extends Parent implements Doable {\n" + |
629 |
" /** @param value */\n" + |
630 |
" void foo(int value) { // X#foo(...)\n" + |
631 |
" }\n" + |
632 |
" void bar(int value) { // X#bar(...)\n" + |
633 |
" }\n" + |
634 |
"\n" + |
635 |
" /** @param value */\n" + |
636 |
" void top(int value) { /* X#top(...)*/}\n" + |
637 |
" /** @param value */\n" + |
638 |
" void parent(int value) { /* X#parent(...) */}\n" + |
639 |
" /** @param value */\n" + |
640 |
" public void doit(int value) { /* X#doit(...) */}\n" + |
641 |
"}\n" + |
642 |
"abstract class Top {\n" + |
643 |
" /** @param value */\n" + |
644 |
" abstract void top(int value); // Top#top(...)\n" + |
645 |
"}\n" + |
646 |
"abstract class Parent extends Top {\n" + |
647 |
" /** @param value */\n" + |
648 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
649 |
"}\n" + |
650 |
"interface Doable {\n" + |
651 |
" /** @param value */\n" + |
652 |
" void doit (int value); // Doable#doit(...)\n" + |
653 |
"}", // ================= |
654 |
}, |
655 |
"----------\n" + |
656 |
"1. ERROR in X.java (at line 3)\n" + |
657 |
" void foo(int value) { // X#foo(...)\n" + |
658 |
" ^^^^^\n" + |
659 |
"The parameter value is never read\n" + |
660 |
"----------\n" + |
661 |
"2. ERROR in X.java (at line 5)\n" + |
662 |
" void bar(int value) { // X#bar(...)\n" + |
663 |
" ^^^^^\n" + |
664 |
"The parameter value is never read\n" + |
665 |
"----------\n" + |
666 |
"3. ERROR in X.java (at line 9)\n" + |
667 |
" void top(int value) { /* X#top(...)*/}\n" + |
668 |
" ^^^^^\n" + |
669 |
"The parameter value is never read\n" + |
670 |
"----------\n" + |
671 |
"4. ERROR in X.java (at line 11)\n" + |
672 |
" void parent(int value) { /* X#parent(...) */}\n" + |
673 |
" ^^^^^\n" + |
674 |
"The parameter value is never read\n" + |
675 |
"----------\n" + |
676 |
"5. ERROR in X.java (at line 13)\n" + |
677 |
" public void doit(int value) { /* X#doit(...) */}\n" + |
678 |
" ^^^^^\n" + |
679 |
"The parameter value is never read\n" + |
680 |
"----------\n" + |
681 |
"6. ERROR in X.java (at line 21)\n" + |
682 |
" void parent(int value) { /* Parent#parent(...) */}\n" + |
683 |
" ^^^^^\n" + |
684 |
"The parameter value is never read\n" + |
685 |
"----------\n", |
686 |
null /* classLib */, |
687 |
true /* shouldFlushOutputDirectory */, |
688 |
options); |
689 |
} |
360 |
public static Class testClass() { |
690 |
public static Class testClass() { |
361 |
return LocalVariableTest.class; |
691 |
return LocalVariableTest.class; |
362 |
} |
692 |
} |