Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 25-30
Link Here
|
25 |
import org.eclipse.core.runtime.CoreException; |
25 |
import org.eclipse.core.runtime.CoreException; |
26 |
import org.eclipse.core.runtime.IPath; |
26 |
import org.eclipse.core.runtime.IPath; |
27 |
import org.eclipse.core.runtime.IProgressMonitor; |
27 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
|
28 |
import org.eclipse.core.runtime.NullProgressMonitor; |
28 |
import org.eclipse.core.runtime.Path; |
29 |
import org.eclipse.core.runtime.Path; |
29 |
import org.eclipse.jdt.core.IAccessRule; |
30 |
import org.eclipse.jdt.core.IAccessRule; |
30 |
import org.eclipse.jdt.core.IClasspathAttribute; |
31 |
import org.eclipse.jdt.core.IClasspathAttribute; |
Lines 417-422
Link Here
|
417 |
this.deleteProject("P3"); |
418 |
this.deleteProject("P3"); |
418 |
} |
419 |
} |
419 |
} |
420 |
} |
|
|
421 |
public void testBug6930_01() throws Exception { |
422 |
Hashtable oldOptions = JavaCore.getOptions(); |
423 |
|
424 |
try { |
425 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
426 |
|
427 |
createFolder("/P/src/p6930"); |
428 |
|
429 |
this.workingCopies = new ICompilationUnit[3]; |
430 |
|
431 |
this.workingCopies[1] = getWorkingCopy("/P/src/p6930/AllConstructors01.java", |
432 |
"package p6930;\n" + |
433 |
"public class AllConstructors01 {\n" + |
434 |
" public AllConstructors01() {}\n" + |
435 |
" public AllConstructors01(Object o) {}\n" + |
436 |
" public AllConstructors01(int o) {}\n" + |
437 |
" public AllConstructors01(Object o, String s) {}\n" + |
438 |
"}\n" |
439 |
); |
440 |
|
441 |
this.workingCopies[2] = getWorkingCopy("/P/src/p6930/AllConstructors01b.java", |
442 |
"package p6930;\n" + |
443 |
"public class AllConstructors01b {\n" + |
444 |
"}\n" |
445 |
); |
446 |
|
447 |
refresh(p); |
448 |
|
449 |
waitUntilIndexesReady(); |
450 |
|
451 |
this.workingCopies[0] = getWorkingCopy( |
452 |
"/P/src/test/Test.java", |
453 |
"package test;"+ |
454 |
"public class Test {\n" + |
455 |
" void foo() {\n" + |
456 |
" new AllConstructors\n" + |
457 |
" }\n" + |
458 |
"}"); |
459 |
|
460 |
// do completion |
461 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
462 |
requestor.allowAllRequiredProposals(); |
463 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
464 |
|
465 |
String str = this.workingCopies[0].getSource(); |
466 |
String completeBehind = "AllConstructors"; |
467 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
468 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
469 |
|
470 |
assertResults( |
471 |
"AllConstructors01[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors01;, ()V, AllConstructors01, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
472 |
" AllConstructors01[TYPE_REF]{p6930.AllConstructors01, p6930, Lp6930.AllConstructors01;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
473 |
"AllConstructors01[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors01;, (I)V, AllConstructors01, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
474 |
" AllConstructors01[TYPE_REF]{p6930.AllConstructors01, p6930, Lp6930.AllConstructors01;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
475 |
"AllConstructors01[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors01;, (Ljava.lang.Object;)V, AllConstructors01, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
476 |
" AllConstructors01[TYPE_REF]{p6930.AllConstructors01, p6930, Lp6930.AllConstructors01;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
477 |
"AllConstructors01[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors01;, (Ljava.lang.Object;Ljava.lang.String;)V, AllConstructors01, (o, s), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
478 |
" AllConstructors01[TYPE_REF]{p6930.AllConstructors01, p6930, Lp6930.AllConstructors01;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
479 |
"AllConstructors01b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors01b;, ()V, AllConstructors01b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
480 |
" AllConstructors01b[TYPE_REF]{p6930.AllConstructors01b, p6930, Lp6930.AllConstructors01b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
481 |
requestor.getResults()); |
482 |
} finally { |
483 |
deleteProject("P"); |
484 |
|
485 |
JavaCore.setOptions(oldOptions); |
486 |
} |
487 |
} |
488 |
public void testBug6930_02() throws Exception { |
489 |
Hashtable oldOptions = JavaCore.getOptions(); |
490 |
|
491 |
try { |
492 |
Hashtable options = new Hashtable(oldOptions); |
493 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
494 |
JavaCore.setOptions(options); |
495 |
|
496 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
497 |
|
498 |
createJar(new String[] { |
499 |
"p6930/AllConstructors02.java", |
500 |
"package p6930;\n" + |
501 |
"public class AllConstructors02 {\n" + |
502 |
" public AllConstructors02() {}\n" + |
503 |
" public AllConstructors02(Object o) {}\n" + |
504 |
" public AllConstructors02(int o) {}\n" + |
505 |
" public AllConstructors02(Object o, String s) {}\n" + |
506 |
"}", |
507 |
"p6930/AllConstructors02b.java", |
508 |
"package p6930;\n" + |
509 |
"public class AllConstructors02b {\n" + |
510 |
"}" |
511 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
512 |
|
513 |
refresh(p); |
514 |
|
515 |
waitUntilIndexesReady(); |
516 |
|
517 |
this.workingCopies = new ICompilationUnit[1]; |
518 |
this.workingCopies[0] = getWorkingCopy( |
519 |
"/P/src/test/Test.java", |
520 |
"package test;"+ |
521 |
"public class Test {\n" + |
522 |
" void foo() {\n" + |
523 |
" new AllConstructors\n" + |
524 |
" }\n" + |
525 |
"}"); |
526 |
|
527 |
// do completion |
528 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
529 |
requestor.allowAllRequiredProposals(); |
530 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
531 |
|
532 |
String str = this.workingCopies[0].getSource(); |
533 |
String completeBehind = "AllConstructors"; |
534 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
535 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
536 |
|
537 |
assertResults( |
538 |
"AllConstructors02[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors02;, ()V, AllConstructors02, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
539 |
" AllConstructors02[TYPE_REF]{p6930.AllConstructors02, p6930, Lp6930.AllConstructors02;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
540 |
"AllConstructors02[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors02;, (I)V, AllConstructors02, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
541 |
" AllConstructors02[TYPE_REF]{p6930.AllConstructors02, p6930, Lp6930.AllConstructors02;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
542 |
"AllConstructors02[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors02;, (Ljava.lang.Object;)V, AllConstructors02, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
543 |
" AllConstructors02[TYPE_REF]{p6930.AllConstructors02, p6930, Lp6930.AllConstructors02;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
544 |
"AllConstructors02[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors02;, (Ljava.lang.Object;Ljava.lang.String;)V, AllConstructors02, (o, s), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
545 |
" AllConstructors02[TYPE_REF]{p6930.AllConstructors02, p6930, Lp6930.AllConstructors02;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
546 |
"AllConstructors02b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors02b;, ()V, AllConstructors02b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
547 |
" AllConstructors02b[TYPE_REF]{p6930.AllConstructors02b, p6930, Lp6930.AllConstructors02b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
548 |
requestor.getResults()); |
549 |
} finally { |
550 |
deleteProject("P"); |
551 |
|
552 |
JavaCore.setOptions(oldOptions); |
553 |
} |
554 |
} |
555 |
public void testBug6930_03() throws Exception { |
556 |
Hashtable oldOptions = JavaCore.getOptions(); |
557 |
|
558 |
try { |
559 |
Hashtable options = new Hashtable(oldOptions); |
560 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
561 |
JavaCore.setOptions(options); |
562 |
|
563 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
564 |
|
565 |
createFolder("/P/src/p6930"); |
566 |
|
567 |
createFile( |
568 |
"/P/src/p6930/AllConstructors03.java", |
569 |
"package p6930;\n" + |
570 |
"public class AllConstructors03 {\n" + |
571 |
" public AllConstructors03() {}\n" + |
572 |
" public AllConstructors03(Object o) {}\n" + |
573 |
" public AllConstructors03(int o) {}\n" + |
574 |
" public AllConstructors03(Object o, String s) {}\n" + |
575 |
"}"); |
576 |
|
577 |
createFile( |
578 |
"/P/src/p6930/AllConstructors03b.java", |
579 |
"package p6930;\n" + |
580 |
"public class AllConstructors03b {\n" + |
581 |
"}"); |
582 |
refresh(p); |
583 |
|
584 |
waitUntilIndexesReady(); |
585 |
|
586 |
this.workingCopies = new ICompilationUnit[1]; |
587 |
this.workingCopies[0] = getWorkingCopy( |
588 |
"/P/src/test/Test.java", |
589 |
"package test;"+ |
590 |
"public class Test {\n" + |
591 |
" void foo() {\n" + |
592 |
" new AllConstructors\n" + |
593 |
" }\n" + |
594 |
"}"); |
595 |
|
596 |
// do completion |
597 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
598 |
requestor.allowAllRequiredProposals(); |
599 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
600 |
|
601 |
String str = this.workingCopies[0].getSource(); |
602 |
String completeBehind = "AllConstructors"; |
603 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
604 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
605 |
|
606 |
assertResults( |
607 |
"AllConstructors03[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors03;, ()V, AllConstructors03, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
608 |
" AllConstructors03[TYPE_REF]{p6930.AllConstructors03, p6930, Lp6930.AllConstructors03;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
609 |
"AllConstructors03[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors03;, (I)V, AllConstructors03, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
610 |
" AllConstructors03[TYPE_REF]{p6930.AllConstructors03, p6930, Lp6930.AllConstructors03;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
611 |
"AllConstructors03[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors03;, (Ljava.lang.Object;)V, AllConstructors03, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
612 |
" AllConstructors03[TYPE_REF]{p6930.AllConstructors03, p6930, Lp6930.AllConstructors03;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
613 |
"AllConstructors03[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors03;, (Ljava.lang.Object;Ljava.lang.String;)V, AllConstructors03, (o, s), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
614 |
" AllConstructors03[TYPE_REF]{p6930.AllConstructors03, p6930, Lp6930.AllConstructors03;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
615 |
"AllConstructors03b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors03b;, ()V, AllConstructors03b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
616 |
" AllConstructors03b[TYPE_REF]{p6930.AllConstructors03b, p6930, Lp6930.AllConstructors03b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
617 |
requestor.getResults()); |
618 |
} finally { |
619 |
deleteProject("P"); |
620 |
|
621 |
JavaCore.setOptions(oldOptions); |
622 |
} |
623 |
} |
624 |
public void testBug6930_04() throws Exception { |
625 |
Hashtable oldOptions = JavaCore.getOptions(); |
626 |
|
627 |
try { |
628 |
Hashtable options = new Hashtable(oldOptions); |
629 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
630 |
JavaCore.setOptions(options); |
631 |
|
632 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
633 |
|
634 |
refresh(p); |
635 |
|
636 |
waitUntilIndexesReady(); |
637 |
|
638 |
this.workingCopies = new ICompilationUnit[2]; |
639 |
this.workingCopies[0] = getWorkingCopy( |
640 |
"/P/src/test/Test.java", |
641 |
"package test;"+ |
642 |
"class AllConstructors04a {\n" + |
643 |
" public class AllConstructors0b {\n" + |
644 |
" }\n" + |
645 |
"}\n" + |
646 |
"public class Test {\n" + |
647 |
" public class AllConstructors04c {\n" + |
648 |
" public class AllConstructors04d {\n" + |
649 |
" }\n" + |
650 |
" }\n" + |
651 |
" void foo() {\n" + |
652 |
" class AllConstructors04e {\n" + |
653 |
" class AllConstructors04f {\n" + |
654 |
" }\n" + |
655 |
" }\n" + |
656 |
" new AllConstructors\n" + |
657 |
" }\n" + |
658 |
"}"); |
659 |
|
660 |
this.workingCopies[1] = getWorkingCopy( |
661 |
"/P/src/test/AllConstructors04g.java", |
662 |
"package test;"+ |
663 |
"public class AllConstructors04g {\n" + |
664 |
" public class AllConstructors0h {\n" + |
665 |
" }\n" + |
666 |
"}"); |
667 |
|
668 |
// do completion |
669 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
670 |
requestor.allowAllRequiredProposals(); |
671 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
672 |
|
673 |
String str = this.workingCopies[0].getSource(); |
674 |
String completeBehind = "AllConstructors"; |
675 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
676 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
677 |
|
678 |
assertResults( |
679 |
"AllConstructors04a[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors04a;, ()V, AllConstructors04a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
680 |
" AllConstructors04a[TYPE_REF]{AllConstructors04a, test, Ltest.AllConstructors04a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
681 |
"AllConstructors04c[CONSTRUCTOR_INVOCATION]{(), Ltest.Test$AllConstructors04c;, ()V, AllConstructors04c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
682 |
" Test.AllConstructors04c[TYPE_REF]{AllConstructors04c, test, Ltest.Test$AllConstructors04c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
683 |
"AllConstructors04e[CONSTRUCTOR_INVOCATION]{(), LAllConstructors04e;, ()V, AllConstructors04e, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
684 |
" AllConstructors04e[TYPE_REF]{AllConstructors04e, null, LAllConstructors04e;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
685 |
"AllConstructors04g[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors04g;, ()V, AllConstructors04g, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
686 |
" AllConstructors04g[TYPE_REF]{AllConstructors04g, test, Ltest.AllConstructors04g;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
687 |
requestor.getResults()); |
688 |
} finally { |
689 |
deleteProject("P"); |
690 |
|
691 |
JavaCore.setOptions(oldOptions); |
692 |
} |
693 |
} |
694 |
public void testBug6930_05() throws Exception { |
695 |
Hashtable oldOptions = JavaCore.getOptions(); |
696 |
|
697 |
try { |
698 |
Hashtable options = new Hashtable(oldOptions); |
699 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
700 |
JavaCore.setOptions(options); |
701 |
|
702 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
703 |
|
704 |
refresh(p); |
705 |
|
706 |
waitUntilIndexesReady(); |
707 |
|
708 |
this.workingCopies = new ICompilationUnit[2]; |
709 |
this.workingCopies[0] = getWorkingCopy( |
710 |
"/P/src/test/Test.java", |
711 |
"package test;"+ |
712 |
"class AllConstructors05a {\n" + |
713 |
" public static class AllConstructors0b {\n" + |
714 |
" }\n" + |
715 |
"}\n" + |
716 |
"public class Test {\n" + |
717 |
" public static class AllConstructors05c {\n" + |
718 |
" public static class AllConstructors05d {\n" + |
719 |
" }\n" + |
720 |
" }\n" + |
721 |
" void foo() {\n" + |
722 |
" new AllConstructors\n" + |
723 |
" }\n" + |
724 |
"}"); |
725 |
|
726 |
this.workingCopies[1] = getWorkingCopy( |
727 |
"/P/src/test/AllConstructors05g.java", |
728 |
"package test;"+ |
729 |
"public class AllConstructors05g {\n" + |
730 |
" public static class AllConstructors0h {\n" + |
731 |
" }\n" + |
732 |
"}"); |
733 |
|
734 |
// do completion |
735 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
736 |
requestor.allowAllRequiredProposals(); |
737 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
738 |
|
739 |
String str = this.workingCopies[0].getSource(); |
740 |
String completeBehind = "AllConstructors"; |
741 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
742 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
743 |
|
744 |
assertResults( |
745 |
"AllConstructors05a[TYPE_REF]{AllConstructors05a, test, Ltest.AllConstructors05a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
746 |
"AllConstructors05a[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors05a;, ()V, AllConstructors05a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
747 |
" AllConstructors05a[TYPE_REF]{AllConstructors05a, test, Ltest.AllConstructors05a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
748 |
"AllConstructors05c[CONSTRUCTOR_INVOCATION]{(), Ltest.Test$AllConstructors05c;, ()V, AllConstructors05c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
749 |
" Test.AllConstructors05c[TYPE_REF]{AllConstructors05c, test, Ltest.Test$AllConstructors05c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
750 |
"AllConstructors05g[TYPE_REF]{AllConstructors05g, test, Ltest.AllConstructors05g;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
751 |
"AllConstructors05g[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors05g;, ()V, AllConstructors05g, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
752 |
" AllConstructors05g[TYPE_REF]{AllConstructors05g, test, Ltest.AllConstructors05g;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
753 |
"Test.AllConstructors05c[TYPE_REF]{AllConstructors05c, test, Ltest.Test$AllConstructors05c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
754 |
requestor.getResults()); |
755 |
} finally { |
756 |
deleteProject("P"); |
757 |
|
758 |
JavaCore.setOptions(oldOptions); |
759 |
} |
760 |
} |
761 |
public void testBug6930_06() throws Exception { |
762 |
Hashtable oldOptions = JavaCore.getOptions(); |
763 |
|
764 |
try { |
765 |
Hashtable options = new Hashtable(oldOptions); |
766 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
767 |
JavaCore.setOptions(options); |
768 |
|
769 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
770 |
|
771 |
createFolder("/P/src/p6930"); |
772 |
|
773 |
createFile( |
774 |
"/P/src/p6930/AllConstructors06a.java", |
775 |
"package p6930;\n" + |
776 |
"public class AllConstructors06a {\n" + |
777 |
"}"); |
778 |
|
779 |
createJar(new String[] { |
780 |
"p6930/AllConstructors06b.java", |
781 |
"package p6930;\n" + |
782 |
"public class AllConstructors06b {\n" + |
783 |
"}" |
784 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
785 |
|
786 |
refresh(p); |
787 |
|
788 |
waitUntilIndexesReady(); |
789 |
|
790 |
this.workingCopies = new ICompilationUnit[2]; |
791 |
this.workingCopies[0] = getWorkingCopy( |
792 |
"/P/src/test/Test.java", |
793 |
"package test;\n"+ |
794 |
"import p6930.AllConstructors06a;\n"+ |
795 |
"import p6930.AllConstructors06b;\n"+ |
796 |
"import p6930.AllConstructors06c;\n"+ |
797 |
"public class Test {\n" + |
798 |
" void foo() {\n" + |
799 |
" new AllConstructors\n" + |
800 |
" }\n" + |
801 |
"}"); |
802 |
|
803 |
this.workingCopies[1] = getWorkingCopy( |
804 |
"/P/src/p6930/AllConstructors06c.java", |
805 |
"package p6930;"+ |
806 |
"public class AllConstructors06c {\n" + |
807 |
"}"); |
808 |
|
809 |
// do completion |
810 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
811 |
requestor.allowAllRequiredProposals(); |
812 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
813 |
|
814 |
String str = this.workingCopies[0].getSource(); |
815 |
String completeBehind = "AllConstructors"; |
816 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
817 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
818 |
|
819 |
assertResults( |
820 |
"AllConstructors06a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors06a;, ()V, AllConstructors06a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
821 |
" AllConstructors06a[TYPE_REF]{AllConstructors06a, p6930, Lp6930.AllConstructors06a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
822 |
"AllConstructors06b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors06b;, ()V, AllConstructors06b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
823 |
" AllConstructors06b[TYPE_REF]{AllConstructors06b, p6930, Lp6930.AllConstructors06b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
824 |
"AllConstructors06c[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors06c;, ()V, AllConstructors06c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
825 |
" AllConstructors06c[TYPE_REF]{AllConstructors06c, p6930, Lp6930.AllConstructors06c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
826 |
requestor.getResults()); |
827 |
|
828 |
} finally { |
829 |
deleteProject("P"); |
830 |
|
831 |
JavaCore.setOptions(oldOptions); |
832 |
} |
833 |
} |
834 |
public void testBug6930_07() throws Exception { |
835 |
Hashtable oldOptions = JavaCore.getOptions(); |
836 |
|
837 |
try { |
838 |
Hashtable options = new Hashtable(oldOptions); |
839 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
840 |
JavaCore.setOptions(options); |
841 |
|
842 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
843 |
|
844 |
createFolder("/P/src/p6930"); |
845 |
|
846 |
createFile( |
847 |
"/P/src/p6930/AllConstructors07a.java", |
848 |
"package p6930;\n" + |
849 |
"public class AllConstructors07a {\n" + |
850 |
" public class AllConstructors07b {\n" + |
851 |
" }\n" + |
852 |
" public static class AllConstructors07c {\n" + |
853 |
" }\n" + |
854 |
"}"); |
855 |
|
856 |
createFile( |
857 |
"/P/src/p6930/AllConstructors07d.java", |
858 |
"package p6930;\n" + |
859 |
"public class AllConstructors07d {\n" + |
860 |
" public class AllConstructors07e {\n" + |
861 |
" }\n" + |
862 |
" public static class AllConstructors07f {\n" + |
863 |
" }\n" + |
864 |
"}"); |
865 |
|
866 |
refresh(p); |
867 |
|
868 |
waitUntilIndexesReady(); |
869 |
|
870 |
this.workingCopies = new ICompilationUnit[1]; |
871 |
this.workingCopies[0] = getWorkingCopy( |
872 |
"/P/src/test/Test.java", |
873 |
"package test;\n"+ |
874 |
"import p6930.*;\n"+ |
875 |
"public class Test {\n" + |
876 |
" void foo() {\n" + |
877 |
" new AllConstructors\n" + |
878 |
" }\n" + |
879 |
"}"); |
880 |
|
881 |
// do completion |
882 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
883 |
requestor.allowAllRequiredProposals(); |
884 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
885 |
|
886 |
String str = this.workingCopies[0].getSource(); |
887 |
String completeBehind = "AllConstructors"; |
888 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
889 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
890 |
|
891 |
assertResults( |
892 |
"AllConstructors07a[TYPE_REF]{AllConstructors07a, p6930, Lp6930.AllConstructors07a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
893 |
"AllConstructors07a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors07a;, ()V, AllConstructors07a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
894 |
" AllConstructors07a[TYPE_REF]{AllConstructors07a, p6930, Lp6930.AllConstructors07a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
895 |
"AllConstructors07d[TYPE_REF]{AllConstructors07d, p6930, Lp6930.AllConstructors07d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
896 |
"AllConstructors07d[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors07d;, ()V, AllConstructors07d, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
897 |
" AllConstructors07d[TYPE_REF]{AllConstructors07d, p6930, Lp6930.AllConstructors07d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
898 |
requestor.getResults()); |
899 |
} finally { |
900 |
deleteProject("P"); |
901 |
|
902 |
JavaCore.setOptions(oldOptions); |
903 |
} |
904 |
} |
905 |
public void testBug6930_08() throws Exception { |
906 |
Hashtable oldOptions = JavaCore.getOptions(); |
907 |
|
908 |
try { |
909 |
Hashtable options = new Hashtable(oldOptions); |
910 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
911 |
JavaCore.setOptions(options); |
912 |
|
913 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5"); |
914 |
|
915 |
createFolder("/P/src/p6930"); |
916 |
|
917 |
createFile( |
918 |
"/P/src/p6930/AllConstructors08a.java", |
919 |
"package p6930;\n" + |
920 |
"public class AllConstructors08a {\n" + |
921 |
" public class AllConstructors08b {\n" + |
922 |
" }\n" + |
923 |
" public static class AllConstructors08c {\n" + |
924 |
" }\n" + |
925 |
"}"); |
926 |
|
927 |
createFile( |
928 |
"/P/src/p6930/AllConstructors08d.java", |
929 |
"package p6930;\n" + |
930 |
"public class AllConstructors08d {\n" + |
931 |
" public class AllConstructors08e {\n" + |
932 |
" }\n" + |
933 |
" public static class AllConstructors08f {\n" + |
934 |
" }\n" + |
935 |
"}"); |
936 |
|
937 |
refresh(p); |
938 |
|
939 |
waitUntilIndexesReady(); |
940 |
|
941 |
this.workingCopies = new ICompilationUnit[1]; |
942 |
this.workingCopies[0] = getWorkingCopy( |
943 |
"/P/src/test/Test.java", |
944 |
"package test;\n"+ |
945 |
"import p6930.AllConstructors08a;\n"+ |
946 |
"public class Test {\n" + |
947 |
" void foo() {\n" + |
948 |
" new AllConstructors\n" + |
949 |
" }\n" + |
950 |
"}"); |
951 |
|
952 |
// do completion |
953 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
954 |
requestor.allowAllRequiredProposals(); |
955 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
956 |
|
957 |
String str = this.workingCopies[0].getSource(); |
958 |
String completeBehind = "AllConstructors"; |
959 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
960 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
961 |
|
962 |
assertResults( |
963 |
"AllConstructors08d[TYPE_REF]{p6930.AllConstructors08d, p6930, Lp6930.AllConstructors08d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
964 |
"AllConstructors08d[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors08d;, ()V, AllConstructors08d, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
965 |
" AllConstructors08d[TYPE_REF]{p6930.AllConstructors08d, p6930, Lp6930.AllConstructors08d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
966 |
"AllConstructors08a[TYPE_REF]{AllConstructors08a, p6930, Lp6930.AllConstructors08a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
967 |
"AllConstructors08a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors08a;, ()V, AllConstructors08a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
968 |
" AllConstructors08a[TYPE_REF]{AllConstructors08a, p6930, Lp6930.AllConstructors08a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
969 |
requestor.getResults()); |
970 |
} finally { |
971 |
deleteProject("P"); |
972 |
|
973 |
JavaCore.setOptions(oldOptions); |
974 |
} |
975 |
} |
976 |
|
977 |
public void testBug6930_09() throws Exception { |
978 |
Hashtable oldOptions = JavaCore.getOptions(); |
979 |
|
980 |
try { |
981 |
Hashtable options = new Hashtable(oldOptions); |
982 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
983 |
JavaCore.setOptions(options); |
984 |
|
985 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5"); |
986 |
|
987 |
createFolder("/P/src/p6930"); |
988 |
|
989 |
createFile( |
990 |
"/P/src/p6930/AllConstructors09a.java", |
991 |
"package p6930;\n" + |
992 |
"public class AllConstructors09a {\n" + |
993 |
" public class AllConstructors09b {\n" + |
994 |
" }\n" + |
995 |
" public static class AllConstructors09c {\n" + |
996 |
" }\n" + |
997 |
"}"); |
998 |
|
999 |
createFile( |
1000 |
"/P/src/p6930/AllConstructors09d.java", |
1001 |
"package p6930;\n" + |
1002 |
"public class AllConstructors09d {\n" + |
1003 |
" public class AllConstructors09e {\n" + |
1004 |
" }\n" + |
1005 |
" public static class AllConstructors09f {\n" + |
1006 |
" public static class AllConstructors09g {\n" + |
1007 |
" }\n" + |
1008 |
" }\n" + |
1009 |
"}"); |
1010 |
|
1011 |
refresh(p); |
1012 |
|
1013 |
waitUntilIndexesReady(); |
1014 |
|
1015 |
this.workingCopies = new ICompilationUnit[1]; |
1016 |
this.workingCopies[0] = getWorkingCopy( |
1017 |
"/P/src/test/Test.java", |
1018 |
"package test;\n"+ |
1019 |
"import p6930.AllConstructors09a.*;\n"+ |
1020 |
"import static p6930.AllConstructors09d.*;\n"+ |
1021 |
"public class Test {\n" + |
1022 |
" void foo() {\n" + |
1023 |
" new AllConstructors\n" + |
1024 |
" }\n" + |
1025 |
"}"); |
1026 |
|
1027 |
// do completion |
1028 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1029 |
requestor.allowAllRequiredProposals(); |
1030 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1031 |
|
1032 |
String str = this.workingCopies[0].getSource(); |
1033 |
String completeBehind = "AllConstructors"; |
1034 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1035 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1036 |
|
1037 |
assertResults( |
1038 |
"AllConstructors09a[TYPE_REF]{p6930.AllConstructors09a, p6930, Lp6930.AllConstructors09a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1039 |
"AllConstructors09a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors09a;, ()V, AllConstructors09a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1040 |
" AllConstructors09a[TYPE_REF]{p6930.AllConstructors09a, p6930, Lp6930.AllConstructors09a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1041 |
"AllConstructors09d[TYPE_REF]{p6930.AllConstructors09d, p6930, Lp6930.AllConstructors09d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1042 |
"AllConstructors09d[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors09d;, ()V, AllConstructors09d, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1043 |
" AllConstructors09d[TYPE_REF]{p6930.AllConstructors09d, p6930, Lp6930.AllConstructors09d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1044 |
"AllConstructors09d.AllConstructors09f[TYPE_REF]{AllConstructors09f, p6930, Lp6930.AllConstructors09d$AllConstructors09f;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1045 |
"AllConstructors09f[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors09d$AllConstructors09f;, ()V, AllConstructors09f, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1046 |
" AllConstructors09d.AllConstructors09f[TYPE_REF]{AllConstructors09f, p6930, Lp6930.AllConstructors09d$AllConstructors09f;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
1047 |
requestor.getResults()); |
1048 |
} finally { |
1049 |
deleteProject("P"); |
1050 |
|
1051 |
JavaCore.setOptions(oldOptions); |
1052 |
} |
1053 |
} |
1054 |
public void testBug6930_10() throws Exception { |
1055 |
Hashtable oldOptions = JavaCore.getOptions(); |
1056 |
|
1057 |
try { |
1058 |
Hashtable options = new Hashtable(oldOptions); |
1059 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1060 |
JavaCore.setOptions(options); |
1061 |
|
1062 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5"); |
1063 |
|
1064 |
createFolder("/P/src/p6930"); |
1065 |
|
1066 |
createFile( |
1067 |
"/P/src/p6930/AllConstructors10a.java", |
1068 |
"package p6930;\n" + |
1069 |
"public class AllConstructors10a {\n" + |
1070 |
" public class AllConstructors10b {\n" + |
1071 |
" public static class AllConstructors10bs {\n" + |
1072 |
" }\n" + |
1073 |
" }\n" + |
1074 |
" public static class AllConstructors10c {\n" + |
1075 |
" public static class AllConstructors10cs {\n" + |
1076 |
" }\n" + |
1077 |
" }\n" + |
1078 |
"}"); |
1079 |
|
1080 |
createFile( |
1081 |
"/P/src/p6930/AllConstructors10d.java", |
1082 |
"package p6930;\n" + |
1083 |
"public class AllConstructors10d {\n" + |
1084 |
" public class AllConstructors10e {\n" + |
1085 |
" public static class AllConstructors10es {\n" + |
1086 |
" }\n" + |
1087 |
" }\n" + |
1088 |
" public static class AllConstructors10f {\n" + |
1089 |
" public static class AllConstructors10fs {\n" + |
1090 |
" }\n" + |
1091 |
" }\n" + |
1092 |
"}"); |
1093 |
|
1094 |
refresh(p); |
1095 |
|
1096 |
waitUntilIndexesReady(); |
1097 |
|
1098 |
this.workingCopies = new ICompilationUnit[1]; |
1099 |
this.workingCopies[0] = getWorkingCopy( |
1100 |
"/P/src/test/Test.java", |
1101 |
"package test;\n"+ |
1102 |
"import p6930.AllConstructors10a.AllConstructors10b;\n"+ |
1103 |
"import p6930.AllConstructors10a.AllConstructors10c;\n"+ |
1104 |
"import static p6930.AllConstructors10d.AllConstructors10e;\n"+ |
1105 |
"import static p6930.AllConstructors10d.AllConstructors10f;\n"+ |
1106 |
"public class Test {\n" + |
1107 |
" void foo() {\n" + |
1108 |
" new AllConstructors\n" + |
1109 |
" }\n" + |
1110 |
"}"); |
1111 |
|
1112 |
// do completion |
1113 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1114 |
requestor.allowAllRequiredProposals(); |
1115 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1116 |
|
1117 |
String str = this.workingCopies[0].getSource(); |
1118 |
String completeBehind = "AllConstructors"; |
1119 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1120 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1121 |
|
1122 |
assertResults( |
1123 |
"AllConstructors10a[TYPE_REF]{p6930.AllConstructors10a, p6930, Lp6930.AllConstructors10a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1124 |
"AllConstructors10a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors10a;, ()V, AllConstructors10a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1125 |
" AllConstructors10a[TYPE_REF]{p6930.AllConstructors10a, p6930, Lp6930.AllConstructors10a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1126 |
"AllConstructors10d[TYPE_REF]{p6930.AllConstructors10d, p6930, Lp6930.AllConstructors10d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1127 |
"AllConstructors10d[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors10d;, ()V, AllConstructors10d, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1128 |
" AllConstructors10d[TYPE_REF]{p6930.AllConstructors10d, p6930, Lp6930.AllConstructors10d;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1129 |
"AllConstructors10a.AllConstructors10c[TYPE_REF]{AllConstructors10c, p6930, Lp6930.AllConstructors10a$AllConstructors10c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1130 |
"AllConstructors10c[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors10a$AllConstructors10c;, ()V, AllConstructors10c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1131 |
" AllConstructors10a.AllConstructors10c[TYPE_REF]{AllConstructors10c, p6930, Lp6930.AllConstructors10a$AllConstructors10c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1132 |
"AllConstructors10d.AllConstructors10f[TYPE_REF]{AllConstructors10f, p6930, Lp6930.AllConstructors10d$AllConstructors10f;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1133 |
"AllConstructors10f[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors10d$AllConstructors10f;, ()V, AllConstructors10f, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1134 |
" AllConstructors10d.AllConstructors10f[TYPE_REF]{AllConstructors10f, p6930, Lp6930.AllConstructors10d$AllConstructors10f;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
1135 |
requestor.getResults()); |
1136 |
} finally { |
1137 |
deleteProject("P"); |
1138 |
|
1139 |
JavaCore.setOptions(oldOptions); |
1140 |
} |
1141 |
} |
1142 |
public void testBug6930_11() throws Exception { |
1143 |
Hashtable oldOptions = JavaCore.getOptions(); |
1144 |
|
1145 |
try { |
1146 |
Hashtable options = new Hashtable(oldOptions); |
1147 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1148 |
JavaCore.setOptions(options); |
1149 |
|
1150 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
1151 |
|
1152 |
createFolder("/P/src/p6930"); |
1153 |
|
1154 |
createFile( |
1155 |
"/P/src/p6930/AllConstructors11a.java", |
1156 |
"package p6930;\n" + |
1157 |
"public class AllConstructors11a {\n" + |
1158 |
"}"); |
1159 |
|
1160 |
|
1161 |
refresh(p); |
1162 |
|
1163 |
waitUntilIndexesReady(); |
1164 |
|
1165 |
this.workingCopies = new ICompilationUnit[1]; |
1166 |
this.workingCopies[0] = getWorkingCopy( |
1167 |
"/P/src/test/Test.java", |
1168 |
"package test;\n"+ |
1169 |
"public class Test {\n" + |
1170 |
" void foo() {\n" + |
1171 |
" p6930.AllConstructors11a a = new \n" + |
1172 |
" }\n" + |
1173 |
"}"); |
1174 |
|
1175 |
// do completion |
1176 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1177 |
requestor.allowAllRequiredProposals(); |
1178 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1179 |
|
1180 |
String str = this.workingCopies[0].getSource(); |
1181 |
String completeBehind = "new "; |
1182 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1183 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1184 |
|
1185 |
assertResults( |
1186 |
"Test[CONSTRUCTOR_INVOCATION]{(), Ltest.Test;, ()V, Test, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1187 |
" Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1188 |
"AllConstructors11a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors11a;, ()V, AllConstructors11a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
1189 |
" AllConstructors11a[TYPE_REF]{p6930.AllConstructors11a, p6930, Lp6930.AllConstructors11a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}", |
1190 |
requestor.getResults()); |
1191 |
} finally { |
1192 |
deleteProject("P"); |
1193 |
|
1194 |
JavaCore.setOptions(oldOptions); |
1195 |
} |
1196 |
} |
1197 |
public void testBug6930_12() throws Exception { |
1198 |
Hashtable oldOptions = JavaCore.getOptions(); |
1199 |
|
1200 |
try { |
1201 |
Hashtable options = new Hashtable(oldOptions); |
1202 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1203 |
JavaCore.setOptions(options); |
1204 |
|
1205 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
1206 |
|
1207 |
createFolder("/P/src/p6930"); |
1208 |
|
1209 |
createFile( |
1210 |
"/P/src/p6930/AllConstructors12a.java", |
1211 |
"package p6930;\n" + |
1212 |
"public class AllConstructors12a {\n" + |
1213 |
" public static class AllConstructors12b {\n" + |
1214 |
" }\n" + |
1215 |
"}"); |
1216 |
|
1217 |
refresh(p); |
1218 |
|
1219 |
waitUntilIndexesReady(); |
1220 |
|
1221 |
this.workingCopies = new ICompilationUnit[1]; |
1222 |
this.workingCopies[0] = getWorkingCopy( |
1223 |
"/P/src/test/Test.java", |
1224 |
"package test;\n"+ |
1225 |
"public class Test {\n" + |
1226 |
" void foo() {\n" + |
1227 |
" p6930.AllConstructors12a a = new \n" + |
1228 |
" }\n" + |
1229 |
"}"); |
1230 |
|
1231 |
// do completion |
1232 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1233 |
requestor.allowAllRequiredProposals(); |
1234 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1235 |
|
1236 |
String str = this.workingCopies[0].getSource(); |
1237 |
String completeBehind = "new "; |
1238 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1239 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1240 |
|
1241 |
assertResults( |
1242 |
"Test[CONSTRUCTOR_INVOCATION]{(), Ltest.Test;, ()V, Test, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1243 |
" Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1244 |
"AllConstructors12a[TYPE_REF]{p6930.AllConstructors12a, p6930, Lp6930.AllConstructors12a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
1245 |
"AllConstructors12a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors12a;, ()V, AllConstructors12a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
1246 |
" AllConstructors12a[TYPE_REF]{p6930.AllConstructors12a, p6930, Lp6930.AllConstructors12a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}", |
1247 |
requestor.getResults()); |
1248 |
} finally { |
1249 |
deleteProject("P"); |
1250 |
|
1251 |
JavaCore.setOptions(oldOptions); |
1252 |
} |
1253 |
} |
1254 |
public void testBug6930_13() throws Exception { |
1255 |
Hashtable oldOptions = JavaCore.getOptions(); |
1256 |
|
1257 |
try { |
1258 |
Hashtable options = new Hashtable(oldOptions); |
1259 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1260 |
JavaCore.setOptions(options); |
1261 |
|
1262 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
1263 |
|
1264 |
createFolder("/P/src/p6930"); |
1265 |
|
1266 |
createFile( |
1267 |
"/P/src/p6930/AllConstructors13a.java", |
1268 |
"package p6930;\n" + |
1269 |
"public class AllConstructors13a {\n" + |
1270 |
"}"); |
1271 |
|
1272 |
|
1273 |
refresh(p); |
1274 |
|
1275 |
waitUntilIndexesReady(); |
1276 |
|
1277 |
this.workingCopies = new ICompilationUnit[1]; |
1278 |
this.workingCopies[0] = getWorkingCopy( |
1279 |
"/P/src/test/Test.java", |
1280 |
"package test;\n"+ |
1281 |
"public class Test {\n" + |
1282 |
" void foo() {\n" + |
1283 |
" p6930.AllConstructors13a a = new AllConstructors\n" + |
1284 |
" }\n" + |
1285 |
"}"); |
1286 |
|
1287 |
// do completion |
1288 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1289 |
requestor.allowAllRequiredProposals(); |
1290 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1291 |
|
1292 |
String str = this.workingCopies[0].getSource(); |
1293 |
String completeBehind = "new AllConstructors"; |
1294 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1295 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1296 |
|
1297 |
assertResults( |
1298 |
"AllConstructors13a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors13a;, ()V, AllConstructors13a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
1299 |
" AllConstructors13a[TYPE_REF]{p6930.AllConstructors13a, p6930, Lp6930.AllConstructors13a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}", |
1300 |
requestor.getResults()); |
1301 |
} finally { |
1302 |
deleteProject("P"); |
1303 |
|
1304 |
JavaCore.setOptions(oldOptions); |
1305 |
} |
1306 |
} |
1307 |
public void testBug6930_14() throws Exception { |
1308 |
Hashtable oldOptions = JavaCore.getOptions(); |
1309 |
|
1310 |
try { |
1311 |
Hashtable options = new Hashtable(oldOptions); |
1312 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1313 |
JavaCore.setOptions(options); |
1314 |
|
1315 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
1316 |
|
1317 |
createFolder("/P/src/p6930"); |
1318 |
|
1319 |
createFile( |
1320 |
"/P/src/p6930/AllConstructors14a.java", |
1321 |
"package p6930;\n" + |
1322 |
"public class AllConstructors14a {\n" + |
1323 |
" public static class AllConstructors14b {\n" + |
1324 |
" }\n" + |
1325 |
"}"); |
1326 |
|
1327 |
refresh(p); |
1328 |
|
1329 |
waitUntilIndexesReady(); |
1330 |
|
1331 |
this.workingCopies = new ICompilationUnit[1]; |
1332 |
this.workingCopies[0] = getWorkingCopy( |
1333 |
"/P/src/test/Test.java", |
1334 |
"package test;\n"+ |
1335 |
"public class Test {\n" + |
1336 |
" void foo() {\n" + |
1337 |
" p6930.AllConstructors14a a = new AllConstructors\n" + |
1338 |
" }\n" + |
1339 |
"}"); |
1340 |
|
1341 |
// do completion |
1342 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1343 |
requestor.allowAllRequiredProposals(); |
1344 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1345 |
|
1346 |
String str = this.workingCopies[0].getSource(); |
1347 |
String completeBehind = "new AllConstructors"; |
1348 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1349 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1350 |
|
1351 |
assertResults( |
1352 |
"AllConstructors14a[TYPE_REF]{p6930.AllConstructors14a, p6930, Lp6930.AllConstructors14a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
1353 |
"AllConstructors14a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors14a;, ()V, AllConstructors14a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
1354 |
" AllConstructors14a[TYPE_REF]{p6930.AllConstructors14a, p6930, Lp6930.AllConstructors14a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}", |
1355 |
requestor.getResults()); |
1356 |
} finally { |
1357 |
deleteProject("P"); |
1358 |
|
1359 |
JavaCore.setOptions(oldOptions); |
1360 |
} |
1361 |
} |
1362 |
public void testBug6930_15() throws Exception { |
1363 |
Hashtable oldOptions = JavaCore.getOptions(); |
1364 |
|
1365 |
try { |
1366 |
Hashtable options = new Hashtable(oldOptions); |
1367 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1368 |
JavaCore.setOptions(options); |
1369 |
|
1370 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5"); |
1371 |
|
1372 |
createFolder("/P/src/p6930"); |
1373 |
|
1374 |
createFile( |
1375 |
"/P/src/p6930/AllConstructors15a.java", |
1376 |
"package p6930;\n" + |
1377 |
"public class AllConstructors15a<T> {\n" + |
1378 |
"}"); |
1379 |
|
1380 |
createJar( |
1381 |
new String[] { |
1382 |
"p6930/AllConstructors15b.java", |
1383 |
"package p6930;\n" + |
1384 |
"public class AllConstructors15b<T> {\n" + |
1385 |
"}" |
1386 |
}, |
1387 |
p.getProject().getLocation().append("lib6930.jar").toOSString(), |
1388 |
new String[]{getExternalJCLPathString("1.5")}, |
1389 |
"1.5"); |
1390 |
|
1391 |
refresh(p); |
1392 |
|
1393 |
waitUntilIndexesReady(); |
1394 |
|
1395 |
this.workingCopies = new ICompilationUnit[2]; |
1396 |
this.workingCopies[0] = getWorkingCopy( |
1397 |
"/P/src/test/Test.java", |
1398 |
"package test;\n"+ |
1399 |
"public class Test {\n" + |
1400 |
" void foo() {\n" + |
1401 |
" new AllConstructors\n" + |
1402 |
" }\n" + |
1403 |
"}"); |
1404 |
|
1405 |
this.workingCopies[1] = getWorkingCopy( |
1406 |
"/P/src/p6930/AllConstructors15c.java", |
1407 |
"package p6930;"+ |
1408 |
"public class AllConstructors15c<T> {\n" + |
1409 |
"}"); |
1410 |
|
1411 |
// do completion |
1412 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1413 |
requestor.allowAllRequiredProposals(); |
1414 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1415 |
|
1416 |
String str = this.workingCopies[0].getSource(); |
1417 |
String completeBehind = "AllConstructors"; |
1418 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1419 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1420 |
|
1421 |
assertResults( |
1422 |
"AllConstructors15a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors15a;, ()V, AllConstructors15a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1423 |
" AllConstructors15a[TYPE_REF]{p6930.AllConstructors15a, p6930, Lp6930.AllConstructors15a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1424 |
"AllConstructors15b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors15b;, ()V, AllConstructors15b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1425 |
" AllConstructors15b[TYPE_REF]{p6930.AllConstructors15b, p6930, Lp6930.AllConstructors15b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1426 |
"AllConstructors15c[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors15c;, ()V, AllConstructors15c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1427 |
" AllConstructors15c[TYPE_REF]{p6930.AllConstructors15c, p6930, Lp6930.AllConstructors15c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
1428 |
requestor.getResults()); |
1429 |
} finally { |
1430 |
deleteProject("P"); |
1431 |
|
1432 |
JavaCore.setOptions(oldOptions); |
1433 |
} |
1434 |
} |
1435 |
public void testBug6930_16() throws Exception { |
1436 |
Hashtable oldOptions = JavaCore.getOptions(); |
1437 |
|
1438 |
try { |
1439 |
Hashtable options = new Hashtable(oldOptions); |
1440 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1441 |
JavaCore.setOptions(options); |
1442 |
|
1443 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5"); |
1444 |
|
1445 |
createFolder("/P/src/p6930"); |
1446 |
|
1447 |
createFile( |
1448 |
"/P/src/p6930/AllConstructors16a.java", |
1449 |
"package p6930;\n" + |
1450 |
"public class AllConstructors16a{\n" + |
1451 |
" public <T> AllConstructors16a(){}\n" + |
1452 |
"}"); |
1453 |
|
1454 |
createJar( |
1455 |
new String[] { |
1456 |
"p6930/AllConstructors16b.java", |
1457 |
"package p6930;\n" + |
1458 |
"public class AllConstructors16b {\n" + |
1459 |
" public <T> AllConstructors16b(){}\n" + |
1460 |
"}" |
1461 |
}, |
1462 |
p.getProject().getLocation().append("lib6930.jar").toOSString(), |
1463 |
new String[]{getExternalJCLPathString("1.5")}, |
1464 |
"1.5"); |
1465 |
|
1466 |
refresh(p); |
1467 |
|
1468 |
waitUntilIndexesReady(); |
1469 |
|
1470 |
this.workingCopies = new ICompilationUnit[2]; |
1471 |
this.workingCopies[0] = getWorkingCopy( |
1472 |
"/P/src/test/Test.java", |
1473 |
"package test;\n"+ |
1474 |
"public class Test {\n" + |
1475 |
" void foo() {\n" + |
1476 |
" new AllConstructors\n" + |
1477 |
" }\n" + |
1478 |
"}"); |
1479 |
|
1480 |
this.workingCopies[1] = getWorkingCopy( |
1481 |
"/P/src/p6930/AllConstructors16c.java", |
1482 |
"package p6930;"+ |
1483 |
"public class AllConstructors16c {\n" + |
1484 |
" public <T> AllConstructors16c(){}\n" + |
1485 |
"}"); |
1486 |
|
1487 |
// do completion |
1488 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1489 |
requestor.allowAllRequiredProposals(); |
1490 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1491 |
|
1492 |
String str = this.workingCopies[0].getSource(); |
1493 |
String completeBehind = "AllConstructors"; |
1494 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1495 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1496 |
|
1497 |
assertResults( |
1498 |
"AllConstructors16a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors16a;, ()V, AllConstructors16a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1499 |
" AllConstructors16a[TYPE_REF]{p6930.AllConstructors16a, p6930, Lp6930.AllConstructors16a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1500 |
"AllConstructors16b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors16b;, ()V, AllConstructors16b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1501 |
" AllConstructors16b[TYPE_REF]{p6930.AllConstructors16b, p6930, Lp6930.AllConstructors16b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1502 |
"AllConstructors16c[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors16c;, ()V, AllConstructors16c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1503 |
" AllConstructors16c[TYPE_REF]{p6930.AllConstructors16c, p6930, Lp6930.AllConstructors16c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
1504 |
requestor.getResults()); |
1505 |
} finally { |
1506 |
deleteProject("P"); |
1507 |
|
1508 |
JavaCore.setOptions(oldOptions); |
1509 |
} |
1510 |
} |
1511 |
public void testBug6930_17() throws Exception { |
1512 |
Hashtable oldOptions = JavaCore.getOptions(); |
1513 |
|
1514 |
try { |
1515 |
Hashtable options = new Hashtable(oldOptions); |
1516 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1517 |
JavaCore.setOptions(options); |
1518 |
|
1519 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5"); |
1520 |
|
1521 |
createFolder("/P/src/p6930"); |
1522 |
|
1523 |
createFile( |
1524 |
"/P/src/p6930/AllConstructors17a.java", |
1525 |
"package p6930;\n" + |
1526 |
"public class AllConstructors17a{\n" + |
1527 |
" public AllConstructors17a(java.util.Collection<Object> o){}\n" + |
1528 |
"}"); |
1529 |
|
1530 |
createJar( |
1531 |
new String[] { |
1532 |
"p6930/AllConstructors17b.java", |
1533 |
"package p6930;\n" + |
1534 |
"public class AllConstructors17b {\n" + |
1535 |
" public AllConstructors17b(java.util.Collection<Object> o){}\n" + |
1536 |
"}" |
1537 |
}, |
1538 |
p.getProject().getLocation().append("lib6930.jar").toOSString(), |
1539 |
new String[]{getExternalJCLPathString("1.5")}, |
1540 |
"1.5"); |
1541 |
|
1542 |
refresh(p); |
1543 |
|
1544 |
waitUntilIndexesReady(); |
1545 |
|
1546 |
this.workingCopies = new ICompilationUnit[2]; |
1547 |
this.workingCopies[0] = getWorkingCopy( |
1548 |
"/P/src/test/Test.java", |
1549 |
"package test;\n"+ |
1550 |
"public class Test {\n" + |
1551 |
" void foo() {\n" + |
1552 |
" new AllConstructors\n" + |
1553 |
" }\n" + |
1554 |
"}"); |
1555 |
|
1556 |
this.workingCopies[1] = getWorkingCopy( |
1557 |
"/P/src/p6930/AllConstructors17c.java", |
1558 |
"package p6930;"+ |
1559 |
"public class AllConstructors17c {\n" + |
1560 |
" public AllConstructors17c(java.util.Collection<Object> o){}\n" + |
1561 |
"}"); |
1562 |
|
1563 |
// do completion |
1564 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1565 |
requestor.allowAllRequiredProposals(); |
1566 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1567 |
|
1568 |
String str = this.workingCopies[0].getSource(); |
1569 |
String completeBehind = "AllConstructors"; |
1570 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1571 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1572 |
|
1573 |
assertResults( |
1574 |
"AllConstructors17a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors17a;, (Ljava.util.Collection<Ljava.lang.Object;>;)V, AllConstructors17a, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1575 |
" AllConstructors17a[TYPE_REF]{p6930.AllConstructors17a, p6930, Lp6930.AllConstructors17a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1576 |
"AllConstructors17b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors17b;, (Ljava.util.Collection<Ljava.lang.Object;>;)V, AllConstructors17b, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1577 |
" AllConstructors17b[TYPE_REF]{p6930.AllConstructors17b, p6930, Lp6930.AllConstructors17b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1578 |
"AllConstructors17c[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors17c;, (Ljava.util.Collection<Ljava.lang.Object;>;)V, AllConstructors17c, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1579 |
" AllConstructors17c[TYPE_REF]{p6930.AllConstructors17c, p6930, Lp6930.AllConstructors17c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
1580 |
requestor.getResults()); |
1581 |
} finally { |
1582 |
deleteProject("P"); |
1583 |
|
1584 |
JavaCore.setOptions(oldOptions); |
1585 |
} |
1586 |
} |
1587 |
public void testBug6930_18() throws Exception { |
1588 |
Hashtable oldOptions = JavaCore.getOptions(); |
1589 |
|
1590 |
try { |
1591 |
Hashtable options = new Hashtable(oldOptions); |
1592 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1593 |
JavaCore.setOptions(options); |
1594 |
|
1595 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
1596 |
|
1597 |
createFolder("/P/src/p6930"); |
1598 |
|
1599 |
createFile( |
1600 |
"/P/src/p6930/AllConstructors18a.java", |
1601 |
"package p6930;\n" + |
1602 |
"public interface AllConstructors18a {\n" + |
1603 |
"}"); |
1604 |
|
1605 |
createJar(new String[] { |
1606 |
"p6930/AllConstructors18b.java", |
1607 |
"package p6930;\n" + |
1608 |
"public interface AllConstructors18b {\n" + |
1609 |
"}" |
1610 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
1611 |
|
1612 |
refresh(p); |
1613 |
|
1614 |
waitUntilIndexesReady(); |
1615 |
|
1616 |
this.workingCopies = new ICompilationUnit[2]; |
1617 |
this.workingCopies[0] = getWorkingCopy( |
1618 |
"/P/src/test/Test.java", |
1619 |
"package test;\n"+ |
1620 |
"public class Test {\n" + |
1621 |
" void foo() {\n" + |
1622 |
" new AllConstructors\n" + |
1623 |
" }\n" + |
1624 |
"}"); |
1625 |
|
1626 |
this.workingCopies[1] = getWorkingCopy( |
1627 |
"/P/src/p6930/AllConstructors18c.java", |
1628 |
"package p6930;"+ |
1629 |
"public interface AllConstructors18c {\n" + |
1630 |
"}"); |
1631 |
|
1632 |
// do completion |
1633 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1634 |
requestor.allowAllRequiredProposals(); |
1635 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1636 |
|
1637 |
String str = this.workingCopies[0].getSource(); |
1638 |
String completeBehind = "AllConstructors"; |
1639 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1640 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1641 |
|
1642 |
assertResults( |
1643 |
"AllConstructors18a[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors18a;, ()V, AllConstructors18a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1644 |
" AllConstructors18a[TYPE_REF]{p6930.AllConstructors18a, p6930, Lp6930.AllConstructors18a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1645 |
"AllConstructors18b[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors18b;, ()V, AllConstructors18b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1646 |
" AllConstructors18b[TYPE_REF]{p6930.AllConstructors18b, p6930, Lp6930.AllConstructors18b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1647 |
"AllConstructors18c[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors18c;, ()V, AllConstructors18c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1648 |
" AllConstructors18c[TYPE_REF]{p6930.AllConstructors18c, p6930, Lp6930.AllConstructors18c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
1649 |
requestor.getResults()); |
1650 |
} finally { |
1651 |
deleteProject("P"); |
1652 |
|
1653 |
JavaCore.setOptions(oldOptions); |
1654 |
} |
1655 |
} |
1656 |
public void testBug6930_19() throws Exception { |
1657 |
Hashtable oldOptions = JavaCore.getOptions(); |
1658 |
|
1659 |
try { |
1660 |
Hashtable options = new Hashtable(oldOptions); |
1661 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1662 |
JavaCore.setOptions(options); |
1663 |
|
1664 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
1665 |
|
1666 |
createFolder("/P/src/p6930"); |
1667 |
|
1668 |
createFile( |
1669 |
"/P/src/p6930/AllConstructors19a.java", |
1670 |
"package p6930;\n" + |
1671 |
"public interface AllConstructors19a {\n" + |
1672 |
"}"); |
1673 |
|
1674 |
createJar(new String[] { |
1675 |
"p6930/AllConstructors19b.java", |
1676 |
"package p6930;\n" + |
1677 |
"public interface AllConstructors19b {\n" + |
1678 |
"}" |
1679 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
1680 |
|
1681 |
refresh(p); |
1682 |
|
1683 |
waitUntilIndexesReady(); |
1684 |
|
1685 |
this.workingCopies = new ICompilationUnit[2]; |
1686 |
this.workingCopies[0] = getWorkingCopy( |
1687 |
"/P/src/test/Test.java", |
1688 |
"package test;\n"+ |
1689 |
"import p6930.AllConstructors19a;\n"+ |
1690 |
"import p6930.AllConstructors19b;\n"+ |
1691 |
"import p6930.AllConstructors19c;\n"+ |
1692 |
"public class Test {\n" + |
1693 |
" void foo() {\n" + |
1694 |
" new AllConstructors\n" + |
1695 |
" }\n" + |
1696 |
"}"); |
1697 |
|
1698 |
this.workingCopies[1] = getWorkingCopy( |
1699 |
"/P/src/p6930/AllConstructors19c.java", |
1700 |
"package p6930;"+ |
1701 |
"public interface AllConstructors19c {\n" + |
1702 |
"}"); |
1703 |
|
1704 |
// do completion |
1705 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1706 |
requestor.allowAllRequiredProposals(); |
1707 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1708 |
|
1709 |
String str = this.workingCopies[0].getSource(); |
1710 |
String completeBehind = "AllConstructors"; |
1711 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1712 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1713 |
|
1714 |
assertResults( |
1715 |
"AllConstructors19a[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors19a;, ()V, AllConstructors19a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1716 |
" AllConstructors19a[TYPE_REF]{AllConstructors19a, p6930, Lp6930.AllConstructors19a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1717 |
"AllConstructors19b[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors19b;, ()V, AllConstructors19b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1718 |
" AllConstructors19b[TYPE_REF]{AllConstructors19b, p6930, Lp6930.AllConstructors19b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1719 |
"AllConstructors19c[ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors19c;, ()V, AllConstructors19c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
1720 |
" AllConstructors19c[TYPE_REF]{AllConstructors19c, p6930, Lp6930.AllConstructors19c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
1721 |
requestor.getResults()); |
1722 |
} finally { |
1723 |
deleteProject("P"); |
1724 |
|
1725 |
JavaCore.setOptions(oldOptions); |
1726 |
} |
1727 |
} |
1728 |
public void testBug6930_20() throws Exception { |
1729 |
Hashtable oldOptions = JavaCore.getOptions(); |
1730 |
|
1731 |
try { |
1732 |
Hashtable options = new Hashtable(oldOptions); |
1733 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1734 |
JavaCore.setOptions(options); |
1735 |
|
1736 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5"); |
1737 |
|
1738 |
createFolder("/P/src/p6930"); |
1739 |
|
1740 |
createFile( |
1741 |
"/P/src/p6930/AllConstructors20a.java", |
1742 |
"package p6930;\n" + |
1743 |
"public enum AllConstructors20a {\n" + |
1744 |
" ZZZ;\n" + |
1745 |
"}"); |
1746 |
|
1747 |
createJar(new String[] { |
1748 |
"p6930/AllConstructors20b.java", |
1749 |
"package p6930;\n" + |
1750 |
"public enum AllConstructors20b {\n" + |
1751 |
" ZZZ;\n" + |
1752 |
"}" |
1753 |
}, |
1754 |
p.getProject().getLocation().append("lib6930.jar").toOSString(), |
1755 |
new String[]{getExternalJCLPathString("1.5")}, |
1756 |
"1.5"); |
1757 |
|
1758 |
refresh(p); |
1759 |
|
1760 |
waitUntilIndexesReady(); |
1761 |
|
1762 |
this.workingCopies = new ICompilationUnit[2]; |
1763 |
this.workingCopies[0] = getWorkingCopy( |
1764 |
"/P/src/test/Test.java", |
1765 |
"package test;\n"+ |
1766 |
"public class Test {\n" + |
1767 |
" void foo() {\n" + |
1768 |
" new AllConstructors\n" + |
1769 |
" }\n" + |
1770 |
"}"); |
1771 |
|
1772 |
this.workingCopies[1] = getWorkingCopy( |
1773 |
"/P/src/p6930/AllConstructors20c.java", |
1774 |
"package p6930;"+ |
1775 |
"public enum AllConstructors20c {\n" + |
1776 |
" ZZZ;\n" + |
1777 |
"}"); |
1778 |
|
1779 |
// do completion |
1780 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1781 |
requestor.allowAllRequiredProposals(); |
1782 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1783 |
|
1784 |
String str = this.workingCopies[0].getSource(); |
1785 |
String completeBehind = "AllConstructors"; |
1786 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1787 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1788 |
|
1789 |
assertResults( |
1790 |
"", |
1791 |
requestor.getResults()); |
1792 |
} finally { |
1793 |
deleteProject("P"); |
1794 |
|
1795 |
JavaCore.setOptions(oldOptions); |
1796 |
} |
1797 |
} |
1798 |
public void testBug6930_21() throws Exception { |
1799 |
Hashtable oldOptions = JavaCore.getOptions(); |
1800 |
|
1801 |
try { |
1802 |
Hashtable options = new Hashtable(oldOptions); |
1803 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1804 |
JavaCore.setOptions(options); |
1805 |
|
1806 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL15_LIB", "/P/lib6930.jar"}, "bin", "1.5"); |
1807 |
|
1808 |
createFolder("/P/src/p6930"); |
1809 |
|
1810 |
createFile( |
1811 |
"/P/src/p6930/AllConstructors21a.java", |
1812 |
"package p6930;\n" + |
1813 |
"public enum AllConstructors21a {\n" + |
1814 |
" ZZZ;\n" + |
1815 |
"}"); |
1816 |
|
1817 |
createJar( |
1818 |
new String[] { |
1819 |
"p6930/AllConstructors21b.java", |
1820 |
"package p6930;\n" + |
1821 |
"public enum AllConstructors21b {\n" + |
1822 |
" ZZZ;\n" + |
1823 |
"}" |
1824 |
}, |
1825 |
p.getProject().getLocation().append("lib6930.jar").toOSString(), |
1826 |
new String[]{getExternalJCLPathString("1.5")}, |
1827 |
"1.5"); |
1828 |
|
1829 |
refresh(p); |
1830 |
|
1831 |
waitUntilIndexesReady(); |
1832 |
|
1833 |
this.workingCopies = new ICompilationUnit[2]; |
1834 |
this.workingCopies[0] = getWorkingCopy( |
1835 |
"/P/src/test/Test.java", |
1836 |
"package test;\n"+ |
1837 |
"import p6930.AllConstructors21a;\n"+ |
1838 |
"import p6930.AllConstructors21b;\n"+ |
1839 |
"import p6930.AllConstructors21c;\n"+ |
1840 |
"public class Test {\n" + |
1841 |
" void foo() {\n" + |
1842 |
" new AllConstructors\n" + |
1843 |
" }\n" + |
1844 |
"}"); |
1845 |
|
1846 |
this.workingCopies[1] = getWorkingCopy( |
1847 |
"/P/src/p6930/AllConstructors21c.java", |
1848 |
"package p6930;"+ |
1849 |
"public enum AllConstructors21c {\n" + |
1850 |
" ZZZ;\n" + |
1851 |
"}"); |
1852 |
|
1853 |
// do completion |
1854 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1855 |
requestor.allowAllRequiredProposals(); |
1856 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1857 |
|
1858 |
String str = this.workingCopies[0].getSource(); |
1859 |
String completeBehind = "AllConstructors"; |
1860 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1861 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1862 |
|
1863 |
assertResults( |
1864 |
"", |
1865 |
requestor.getResults()); |
1866 |
} finally { |
1867 |
deleteProject("P"); |
1868 |
|
1869 |
JavaCore.setOptions(oldOptions); |
1870 |
} |
1871 |
} |
1872 |
public void testBug6930_22() throws Exception { |
1873 |
Hashtable oldOptions = JavaCore.getOptions(); |
1874 |
|
1875 |
try { |
1876 |
Hashtable options = new Hashtable(oldOptions); |
1877 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1878 |
JavaCore.setOptions(options); |
1879 |
|
1880 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
1881 |
|
1882 |
createFolder("/P/src/p6930"); |
1883 |
|
1884 |
createFile( |
1885 |
"/P/src/p6930/AllConstructors22a.java", |
1886 |
"package p6930;\n" + |
1887 |
"public class AllConstructors22a {\n" + |
1888 |
" private AllConstructors22a(){}\n" + |
1889 |
" public static class AllConstructorsInner{}\n" + |
1890 |
"}"); |
1891 |
|
1892 |
createJar(new String[] { |
1893 |
"p6930/AllConstructors22b.java", |
1894 |
"package p6930;\n" + |
1895 |
"public class AllConstructors22b {\n" + |
1896 |
" private AllConstructors22b(){}\n" + |
1897 |
" public static class AllConstructorsInner{}\n" + |
1898 |
"}" |
1899 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
1900 |
|
1901 |
refresh(p); |
1902 |
|
1903 |
waitUntilIndexesReady(); |
1904 |
|
1905 |
this.workingCopies = new ICompilationUnit[2]; |
1906 |
this.workingCopies[0] = getWorkingCopy( |
1907 |
"/P/src/test/Test.java", |
1908 |
"package test;\n"+ |
1909 |
"public class Test {\n" + |
1910 |
" void foo() {\n" + |
1911 |
" new AllConstructors\n" + |
1912 |
" }\n" + |
1913 |
"}"); |
1914 |
|
1915 |
this.workingCopies[1] = getWorkingCopy( |
1916 |
"/P/src/p6930/AllConstructors22c.java", |
1917 |
"package p6930;"+ |
1918 |
"public class AllConstructors22c {\n" + |
1919 |
" private AllConstructors22c(){}\n" + |
1920 |
" public static class AllConstructorsInner{}\n" + |
1921 |
"}"); |
1922 |
|
1923 |
// do completion |
1924 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
1925 |
requestor.allowAllRequiredProposals(); |
1926 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
1927 |
|
1928 |
String str = this.workingCopies[0].getSource(); |
1929 |
String completeBehind = "AllConstructors"; |
1930 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
1931 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
1932 |
|
1933 |
assertResults( |
1934 |
"AllConstructors22a[TYPE_REF]{p6930.AllConstructors22a, p6930, Lp6930.AllConstructors22a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1935 |
"AllConstructors22b[TYPE_REF]{p6930.AllConstructors22b, p6930, Lp6930.AllConstructors22b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
1936 |
"AllConstructors22c[TYPE_REF]{p6930.AllConstructors22c, p6930, Lp6930.AllConstructors22c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
1937 |
requestor.getResults()); |
1938 |
} finally { |
1939 |
deleteProject("P"); |
1940 |
|
1941 |
JavaCore.setOptions(oldOptions); |
1942 |
} |
1943 |
} |
1944 |
public void testBug6930_23() throws Exception { |
1945 |
Hashtable oldOptions = JavaCore.getOptions(); |
1946 |
|
1947 |
try { |
1948 |
Hashtable options = new Hashtable(oldOptions); |
1949 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
1950 |
JavaCore.setOptions(options); |
1951 |
|
1952 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
1953 |
|
1954 |
createFolder("/P/src/p6930"); |
1955 |
|
1956 |
createFile( |
1957 |
"/P/src/p6930/AllConstructors23a.java", |
1958 |
"package p6930;\n" + |
1959 |
"public class AllConstructors23a {\n" + |
1960 |
" private AllConstructors23a(){}\n" + |
1961 |
" public static class AllConstructorsInner{}\n" + |
1962 |
"}"); |
1963 |
|
1964 |
createJar(new String[] { |
1965 |
"p6930/AllConstructors23b.java", |
1966 |
"package p6930;\n" + |
1967 |
"public class AllConstructors23b {\n" + |
1968 |
" private AllConstructors23b(){}\n" + |
1969 |
" public static class AllConstructorsInner{}\n" + |
1970 |
"}" |
1971 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
1972 |
|
1973 |
refresh(p); |
1974 |
|
1975 |
waitUntilIndexesReady(); |
1976 |
|
1977 |
this.workingCopies = new ICompilationUnit[2]; |
1978 |
this.workingCopies[0] = getWorkingCopy( |
1979 |
"/P/src/test/Test.java", |
1980 |
"package test;\n"+ |
1981 |
"import p6930.AllConstructors23a;\n"+ |
1982 |
"import p6930.AllConstructors23b;\n"+ |
1983 |
"import p6930.AllConstructors23c;\n"+ |
1984 |
"public class Test {\n" + |
1985 |
" void foo() {\n" + |
1986 |
" new AllConstructors\n" + |
1987 |
" }\n" + |
1988 |
"}"); |
1989 |
|
1990 |
this.workingCopies[1] = getWorkingCopy( |
1991 |
"/P/src/p6930/AllConstructors23c.java", |
1992 |
"package p6930;"+ |
1993 |
"public class AllConstructors23c {\n" + |
1994 |
" private AllConstructors23c(){}\n" + |
1995 |
" public static class AllConstructorsInner{}\n" + |
1996 |
"}"); |
1997 |
|
1998 |
// do completion |
1999 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2000 |
requestor.allowAllRequiredProposals(); |
2001 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2002 |
|
2003 |
String str = this.workingCopies[0].getSource(); |
2004 |
String completeBehind = "AllConstructors"; |
2005 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2006 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2007 |
|
2008 |
assertResults( |
2009 |
"AllConstructors23a[TYPE_REF]{AllConstructors23a, p6930, Lp6930.AllConstructors23a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2010 |
"AllConstructors23b[TYPE_REF]{AllConstructors23b, p6930, Lp6930.AllConstructors23b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2011 |
"AllConstructors23c[TYPE_REF]{AllConstructors23c, p6930, Lp6930.AllConstructors23c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
2012 |
requestor.getResults()); |
2013 |
} finally { |
2014 |
deleteProject("P"); |
2015 |
|
2016 |
JavaCore.setOptions(oldOptions); |
2017 |
} |
2018 |
} |
2019 |
public void testBug6930_24() throws Exception { |
2020 |
Hashtable oldOptions = JavaCore.getOptions(); |
2021 |
|
2022 |
try { |
2023 |
Hashtable options = new Hashtable(oldOptions); |
2024 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2025 |
JavaCore.setOptions(options); |
2026 |
|
2027 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
2028 |
|
2029 |
createFolder("/P/src/p6930"); |
2030 |
|
2031 |
createFile( |
2032 |
"/P/src/p6930/AllConstructors24a.java", |
2033 |
"package p6930;\n" + |
2034 |
"public class AllConstructors24a {\n" + |
2035 |
" public AllConstructors24a(){}\n" + |
2036 |
" private static class AllConstructorsInner{}\n" + |
2037 |
"}"); |
2038 |
|
2039 |
createJar(new String[] { |
2040 |
"p6930/AllConstructors24b.java", |
2041 |
"package p6930;\n" + |
2042 |
"public class AllConstructors24b {\n" + |
2043 |
" public AllConstructors24b(){}\n" + |
2044 |
" private static class AllConstructorsInner{}\n" + |
2045 |
"}" |
2046 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
2047 |
|
2048 |
refresh(p); |
2049 |
|
2050 |
waitUntilIndexesReady(); |
2051 |
|
2052 |
this.workingCopies = new ICompilationUnit[2]; |
2053 |
this.workingCopies[0] = getWorkingCopy( |
2054 |
"/P/src/test/Test.java", |
2055 |
"package test;\n"+ |
2056 |
"public class Test {\n" + |
2057 |
" void foo() {\n" + |
2058 |
" new AllConstructors\n" + |
2059 |
" }\n" + |
2060 |
"}"); |
2061 |
|
2062 |
this.workingCopies[1] = getWorkingCopy( |
2063 |
"/P/src/p6930/AllConstructors24c.java", |
2064 |
"package p6930;"+ |
2065 |
"public class AllConstructors24c {\n" + |
2066 |
" public AllConstructors24c(){}\n" + |
2067 |
" private static class AllConstructorsInner{}\n" + |
2068 |
"}"); |
2069 |
|
2070 |
// do completion |
2071 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2072 |
requestor.allowAllRequiredProposals(); |
2073 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2074 |
|
2075 |
String str = this.workingCopies[0].getSource(); |
2076 |
String completeBehind = "AllConstructors"; |
2077 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2078 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2079 |
|
2080 |
assertResults( |
2081 |
"AllConstructors24a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors24a;, ()V, AllConstructors24a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2082 |
" AllConstructors24a[TYPE_REF]{p6930.AllConstructors24a, p6930, Lp6930.AllConstructors24a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2083 |
"AllConstructors24b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors24b;, ()V, AllConstructors24b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2084 |
" AllConstructors24b[TYPE_REF]{p6930.AllConstructors24b, p6930, Lp6930.AllConstructors24b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2085 |
"AllConstructors24c[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors24c;, ()V, AllConstructors24c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2086 |
" AllConstructors24c[TYPE_REF]{p6930.AllConstructors24c, p6930, Lp6930.AllConstructors24c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
2087 |
requestor.getResults()); |
2088 |
} finally { |
2089 |
deleteProject("P"); |
2090 |
|
2091 |
JavaCore.setOptions(oldOptions); |
2092 |
} |
2093 |
} |
2094 |
public void testBug6930_25() throws Exception { |
2095 |
Hashtable oldOptions = JavaCore.getOptions(); |
2096 |
|
2097 |
try { |
2098 |
Hashtable options = new Hashtable(oldOptions); |
2099 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2100 |
JavaCore.setOptions(options); |
2101 |
|
2102 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
2103 |
|
2104 |
createFolder("/P/src/p6930"); |
2105 |
|
2106 |
createFile( |
2107 |
"/P/src/p6930/AllConstructors25a.java", |
2108 |
"package p6930;\n" + |
2109 |
"public class AllConstructors25a {\n" + |
2110 |
" public AllConstructors25a(){}\n" + |
2111 |
" private static class AllConstructorsInner{}\n" + |
2112 |
"}"); |
2113 |
|
2114 |
createJar(new String[] { |
2115 |
"p6930/AllConstructors25b.java", |
2116 |
"package p6930;\n" + |
2117 |
"public class AllConstructors25b {\n" + |
2118 |
" public AllConstructors25b(){}\n" + |
2119 |
" private static class AllConstructorsInner{}\n" + |
2120 |
"}" |
2121 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
2122 |
|
2123 |
refresh(p); |
2124 |
|
2125 |
waitUntilIndexesReady(); |
2126 |
|
2127 |
this.workingCopies = new ICompilationUnit[2]; |
2128 |
this.workingCopies[0] = getWorkingCopy( |
2129 |
"/P/src/test/Test.java", |
2130 |
"package test;\n"+ |
2131 |
"import p6930.AllConstructors25a;\n"+ |
2132 |
"import p6930.AllConstructors25b;\n"+ |
2133 |
"import p6930.AllConstructors25c;\n"+ |
2134 |
"public class Test {\n" + |
2135 |
" void foo() {\n" + |
2136 |
" new AllConstructors\n" + |
2137 |
" }\n" + |
2138 |
"}"); |
2139 |
|
2140 |
this.workingCopies[1] = getWorkingCopy( |
2141 |
"/P/src/p6930/AllConstructors25c.java", |
2142 |
"package p6930;"+ |
2143 |
"public class AllConstructors25c {\n" + |
2144 |
" public AllConstructors25c(){}\n" + |
2145 |
" private static class AllConstructorsInner{}\n" + |
2146 |
"}"); |
2147 |
|
2148 |
// do completion |
2149 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2150 |
requestor.allowAllRequiredProposals(); |
2151 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2152 |
|
2153 |
String str = this.workingCopies[0].getSource(); |
2154 |
String completeBehind = "AllConstructors"; |
2155 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2156 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2157 |
|
2158 |
assertResults( |
2159 |
"AllConstructors25a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors25a;, ()V, AllConstructors25a, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2160 |
" AllConstructors25a[TYPE_REF]{AllConstructors25a, p6930, Lp6930.AllConstructors25a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2161 |
"AllConstructors25b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors25b;, ()V, AllConstructors25b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2162 |
" AllConstructors25b[TYPE_REF]{AllConstructors25b, p6930, Lp6930.AllConstructors25b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2163 |
"AllConstructors25c[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors25c;, ()V, AllConstructors25c, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2164 |
" AllConstructors25c[TYPE_REF]{AllConstructors25c, p6930, Lp6930.AllConstructors25c;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
2165 |
requestor.getResults()); |
2166 |
} finally { |
2167 |
deleteProject("P"); |
2168 |
|
2169 |
JavaCore.setOptions(oldOptions); |
2170 |
} |
2171 |
} |
2172 |
public void testBug6930_26() throws Exception { |
2173 |
Hashtable oldOptions = JavaCore.getOptions(); |
2174 |
|
2175 |
try { |
2176 |
Hashtable options = new Hashtable(oldOptions); |
2177 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2178 |
JavaCore.setOptions(options); |
2179 |
|
2180 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
2181 |
|
2182 |
refresh(p); |
2183 |
|
2184 |
waitUntilIndexesReady(); |
2185 |
|
2186 |
this.workingCopies = new ICompilationUnit[2]; |
2187 |
this.workingCopies[0] = getWorkingCopy( |
2188 |
"/P/src/test/Test.java", |
2189 |
"package test;\n"+ |
2190 |
"public class Test {\n" + |
2191 |
" void foo(p6930.AllConstructors26a var) {\n" + |
2192 |
" var.new AllConstructors\n" + |
2193 |
" }\n" + |
2194 |
"}"); |
2195 |
|
2196 |
this.workingCopies[1] = getWorkingCopy( |
2197 |
"/P/src/p6930/AllConstructors26a.java", |
2198 |
"package p6930;"+ |
2199 |
"public class AllConstructors26a {\n" + |
2200 |
" public class AllConstructors26b {\n" + |
2201 |
" public AllConstructors26b(int i) {}\n" + |
2202 |
" }\n" + |
2203 |
"}"); |
2204 |
|
2205 |
// do completion |
2206 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2207 |
requestor.allowAllRequiredProposals(); |
2208 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2209 |
|
2210 |
String str = this.workingCopies[0].getSource(); |
2211 |
String completeBehind = "AllConstructors"; |
2212 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2213 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2214 |
|
2215 |
assertResults( |
2216 |
"AllConstructors26b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors26a$AllConstructors26b;, (I)V, AllConstructors26b, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2217 |
" AllConstructors26a.AllConstructors26b[TYPE_REF]{AllConstructors26b, p6930, Lp6930.AllConstructors26a$AllConstructors26b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
2218 |
requestor.getResults()); |
2219 |
} finally { |
2220 |
deleteProject("P"); |
2221 |
|
2222 |
JavaCore.setOptions(oldOptions); |
2223 |
} |
2224 |
} |
2225 |
public void testBug6930_27() throws Exception { |
2226 |
Hashtable oldOptions = JavaCore.getOptions(); |
2227 |
|
2228 |
try { |
2229 |
Hashtable options = new Hashtable(oldOptions); |
2230 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2231 |
JavaCore.setOptions(options); |
2232 |
|
2233 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
2234 |
|
2235 |
refresh(p); |
2236 |
|
2237 |
waitUntilIndexesReady(); |
2238 |
|
2239 |
this.workingCopies = new ICompilationUnit[2]; |
2240 |
this.workingCopies[0] = getWorkingCopy( |
2241 |
"/P/src/test/Test.java", |
2242 |
"package test;\n"+ |
2243 |
"public class Test {\n" + |
2244 |
" void foo() {\n" + |
2245 |
" new p6930.AllConstructors27a.AllConstructors\n" + |
2246 |
" }\n" + |
2247 |
"}"); |
2248 |
|
2249 |
this.workingCopies[1] = getWorkingCopy( |
2250 |
"/P/src/p6930/AllConstructors27a.java", |
2251 |
"package p6930;"+ |
2252 |
"public class AllConstructors27a {\n" + |
2253 |
" public static class AllConstructors27b {\n" + |
2254 |
" public AllConstructors27b(int i) {}\n" + |
2255 |
" }\n" + |
2256 |
"}"); |
2257 |
|
2258 |
// do completion |
2259 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2260 |
requestor.allowAllRequiredProposals(); |
2261 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2262 |
|
2263 |
String str = this.workingCopies[0].getSource(); |
2264 |
String completeBehind = "AllConstructors"; |
2265 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2266 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2267 |
|
2268 |
assertResults( |
2269 |
"AllConstructors27b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors27a$AllConstructors27b;, (I)V, AllConstructors27b, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2270 |
" AllConstructors27a.AllConstructors27b[TYPE_REF]{AllConstructors27b, p6930, Lp6930.AllConstructors27a$AllConstructors27b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
2271 |
requestor.getResults()); |
2272 |
} finally { |
2273 |
deleteProject("P"); |
2274 |
|
2275 |
JavaCore.setOptions(oldOptions); |
2276 |
} |
2277 |
} |
2278 |
public void testBug6930_28() throws Exception { |
2279 |
Hashtable oldOptions = JavaCore.getOptions(); |
2280 |
|
2281 |
try { |
2282 |
Hashtable options = new Hashtable(oldOptions); |
2283 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2284 |
JavaCore.setOptions(options); |
2285 |
|
2286 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
2287 |
|
2288 |
refresh(p); |
2289 |
|
2290 |
waitUntilIndexesReady(); |
2291 |
|
2292 |
this.workingCopies = new ICompilationUnit[3]; |
2293 |
this.workingCopies[0] = getWorkingCopy( |
2294 |
"/P/src/p6930/Test.java", |
2295 |
"package p6930;\n"+ |
2296 |
"class AllConstructors28a {\n" + |
2297 |
" public AllConstructors28a(int i) {}\n" + |
2298 |
"}\n" + |
2299 |
"public class Test {\n" + |
2300 |
" void foo() {\n" + |
2301 |
" new p6930.AllConstructors\n" + |
2302 |
" }\n" + |
2303 |
"}"); |
2304 |
|
2305 |
this.workingCopies[1] = getWorkingCopy( |
2306 |
"/P/src/p6930/AllConstructors28b.java", |
2307 |
"package p6930;"+ |
2308 |
"public class AllConstructors28b {\n" + |
2309 |
" public AllConstructors28b(int i) {}\n" + |
2310 |
"}"); |
2311 |
|
2312 |
this.workingCopies[2] = getWorkingCopy( |
2313 |
"/P/src/p6930b/AllConstructors28c.java", |
2314 |
"package p6930b;"+ |
2315 |
"public class AllConstructors28c {\n" + |
2316 |
" public AllConstructors28c(int i) {}\n" + |
2317 |
"}"); |
2318 |
|
2319 |
// do completion |
2320 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2321 |
requestor.allowAllRequiredProposals(); |
2322 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2323 |
|
2324 |
String str = this.workingCopies[0].getSource(); |
2325 |
String completeBehind = "AllConstructors"; |
2326 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2327 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2328 |
|
2329 |
assertResults( |
2330 |
"AllConstructors28a[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors28a;, (I)V, AllConstructors28a, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2331 |
" AllConstructors28a[TYPE_REF]{AllConstructors28a, p6930, Lp6930.AllConstructors28a;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2332 |
"AllConstructors28b[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors28b;, (I)V, AllConstructors28b, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2333 |
" AllConstructors28b[TYPE_REF]{AllConstructors28b, p6930, Lp6930.AllConstructors28b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
2334 |
requestor.getResults()); |
2335 |
} finally { |
2336 |
deleteProject("P"); |
2337 |
|
2338 |
JavaCore.setOptions(oldOptions); |
2339 |
} |
2340 |
} |
2341 |
public void testBug6930_29() throws Exception { |
2342 |
Hashtable oldOptions = JavaCore.getOptions(); |
2343 |
|
2344 |
try { |
2345 |
Hashtable options = new Hashtable(oldOptions); |
2346 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2347 |
JavaCore.setOptions(options); |
2348 |
|
2349 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB", "/P/lib6930.jar"}, "bin"); |
2350 |
|
2351 |
createJar(new String[] { |
2352 |
"p6930/AllConstructors29.java", |
2353 |
"package p6930;\n" + |
2354 |
"public class AllConstructors29 {\n" + |
2355 |
" public AllConstructors29() {}\n" + |
2356 |
" public AllConstructors29(Object o) {}\n" + |
2357 |
" public AllConstructors29(Object o, String s) {}\n" + |
2358 |
"}" |
2359 |
}, p.getProject().getLocation().append("lib6930.jar").toOSString()); |
2360 |
|
2361 |
refresh(p); |
2362 |
|
2363 |
waitUntilIndexesReady(); |
2364 |
|
2365 |
this.workingCopies = new ICompilationUnit[1]; |
2366 |
this.workingCopies[0] = getWorkingCopy( |
2367 |
"/P/src/test/Test.java", |
2368 |
"package test;"+ |
2369 |
"public class Test {\n" + |
2370 |
" void foo() {\n" + |
2371 |
" p6930.AllConstructors29 var = new AllConstructors\n" + |
2372 |
" }\n" + |
2373 |
"}"); |
2374 |
|
2375 |
// do completion |
2376 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2377 |
requestor.allowAllRequiredProposals(); |
2378 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2379 |
|
2380 |
String str = this.workingCopies[0].getSource(); |
2381 |
String completeBehind = "AllConstructors"; |
2382 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2383 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2384 |
|
2385 |
assertResults( |
2386 |
"AllConstructors29[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors29;, ()V, AllConstructors29, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
2387 |
" AllConstructors29[TYPE_REF]{p6930.AllConstructors29, p6930, Lp6930.AllConstructors29;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
2388 |
"AllConstructors29[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors29;, (Ljava.lang.Object;)V, AllConstructors29, (o), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
2389 |
" AllConstructors29[TYPE_REF]{p6930.AllConstructors29, p6930, Lp6930.AllConstructors29;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
2390 |
"AllConstructors29[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors29;, (Ljava.lang.Object;Ljava.lang.String;)V, AllConstructors29, (o, s), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n" + |
2391 |
" AllConstructors29[TYPE_REF]{p6930.AllConstructors29, p6930, Lp6930.AllConstructors29;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}", |
2392 |
requestor.getResults()); |
2393 |
} finally { |
2394 |
deleteProject("P"); |
2395 |
|
2396 |
JavaCore.setOptions(oldOptions); |
2397 |
} |
2398 |
} |
2399 |
public void testBug6930_30() throws Exception { |
2400 |
Hashtable oldOptions = JavaCore.getOptions(); |
2401 |
|
2402 |
try { |
2403 |
Hashtable options = new Hashtable(oldOptions); |
2404 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2405 |
JavaCore.setOptions(options); |
2406 |
|
2407 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
2408 |
|
2409 |
refresh(p); |
2410 |
|
2411 |
waitUntilIndexesReady(); |
2412 |
|
2413 |
this.workingCopies = new ICompilationUnit[1]; |
2414 |
this.workingCopies[0] = getWorkingCopy( |
2415 |
"/P/src/test/AllConstructors30.java", |
2416 |
"package test;"+ |
2417 |
"class AllConstructors30b {\n" + |
2418 |
" private class Innerb {}\n" + |
2419 |
"}\n" + |
2420 |
"public class AllConstructors30 {\n" + |
2421 |
" private class Inner {}\n" + |
2422 |
" void foo() {\n" + |
2423 |
" new AllConstructors\n" + |
2424 |
" }\n" + |
2425 |
"}"); |
2426 |
|
2427 |
// do completion |
2428 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2429 |
requestor.allowAllRequiredProposals(); |
2430 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2431 |
|
2432 |
String str = this.workingCopies[0].getSource(); |
2433 |
String completeBehind = "AllConstructors"; |
2434 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2435 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2436 |
|
2437 |
assertResults( |
2438 |
"AllConstructors30[TYPE_REF]{AllConstructors30, test, Ltest.AllConstructors30;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2439 |
"AllConstructors30[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors30;, ()V, AllConstructors30, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2440 |
" AllConstructors30[TYPE_REF]{AllConstructors30, test, Ltest.AllConstructors30;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2441 |
"AllConstructors30b[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors30b;, ()V, AllConstructors30b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2442 |
" AllConstructors30b[TYPE_REF]{AllConstructors30b, test, Ltest.AllConstructors30b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
2443 |
requestor.getResults()); |
2444 |
} finally { |
2445 |
deleteProject("P"); |
2446 |
|
2447 |
JavaCore.setOptions(oldOptions); |
2448 |
} |
2449 |
} |
2450 |
public void testBug6930_31() throws Exception { |
2451 |
Hashtable oldOptions = JavaCore.getOptions(); |
2452 |
|
2453 |
try { |
2454 |
Hashtable options = new Hashtable(oldOptions); |
2455 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2456 |
JavaCore.setOptions(options); |
2457 |
|
2458 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
2459 |
|
2460 |
refresh(p); |
2461 |
|
2462 |
waitUntilIndexesReady(); |
2463 |
|
2464 |
this.workingCopies = new ICompilationUnit[1]; |
2465 |
this.workingCopies[0] = getWorkingCopy( |
2466 |
"/P/src/test/AllConstructors31.java", |
2467 |
"package test;"+ |
2468 |
"class AllConstructors31b {\n" + |
2469 |
" private class Innerb {}\n" + |
2470 |
"}\n" + |
2471 |
"public class AllConstructors31 {\n" + |
2472 |
" public class Inner {\n" + |
2473 |
" }\n" + |
2474 |
" void foo() {\n" + |
2475 |
" AllConstructors31.Inner var = new AllConstructors\n" + |
2476 |
" }\n" + |
2477 |
"}"); |
2478 |
|
2479 |
// do completion |
2480 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2481 |
requestor.allowAllRequiredProposals(); |
2482 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2483 |
|
2484 |
String str = this.workingCopies[0].getSource(); |
2485 |
String completeBehind = "AllConstructors"; |
2486 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2487 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2488 |
|
2489 |
assertResults( |
2490 |
"AllConstructors31[TYPE_REF]{AllConstructors31, test, Ltest.AllConstructors31;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2491 |
"AllConstructors31[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors31;, ()V, AllConstructors31, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2492 |
" AllConstructors31[TYPE_REF]{AllConstructors31, test, Ltest.AllConstructors31;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2493 |
"AllConstructors31b[CONSTRUCTOR_INVOCATION]{(), Ltest.AllConstructors31b;, ()V, AllConstructors31b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" + |
2494 |
" AllConstructors31b[TYPE_REF]{AllConstructors31b, test, Ltest.AllConstructors31b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
2495 |
requestor.getResults()); |
2496 |
} finally { |
2497 |
deleteProject("P"); |
2498 |
|
2499 |
JavaCore.setOptions(oldOptions); |
2500 |
} |
2501 |
} |
2502 |
public void testBug6930_32() throws Exception { |
2503 |
Hashtable oldOptions = JavaCore.getOptions(); |
2504 |
|
2505 |
try { |
2506 |
Hashtable options = new Hashtable(oldOptions); |
2507 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2508 |
JavaCore.setOptions(options); |
2509 |
|
2510 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
2511 |
|
2512 |
refresh(p); |
2513 |
|
2514 |
waitUntilIndexesReady(); |
2515 |
|
2516 |
this.workingCopies = new ICompilationUnit[1]; |
2517 |
this.workingCopies[0] = getWorkingCopy( |
2518 |
"/P/src/test/Test.java", |
2519 |
"package test;"+ |
2520 |
"public class Test {\n" + |
2521 |
" public class AllConstructors32b {\n" + |
2522 |
" private class Innerb {}\n" + |
2523 |
" }\n" + |
2524 |
" public class AllConstructors32 {\n" + |
2525 |
" public class Inner {}\n" + |
2526 |
" void foo() {\n" + |
2527 |
" new Test.AllConstructors\n" + |
2528 |
" }\n" + |
2529 |
" }\n" + |
2530 |
"}"); |
2531 |
|
2532 |
// do completion |
2533 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2534 |
requestor.allowAllRequiredProposals(); |
2535 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2536 |
|
2537 |
String str = this.workingCopies[0].getSource(); |
2538 |
String completeBehind = "AllConstructors"; |
2539 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2540 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2541 |
|
2542 |
assertResults( |
2543 |
"AllConstructors32[CONSTRUCTOR_INVOCATION]{(), Ltest.Test$AllConstructors32;, ()V, AllConstructors32, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2544 |
" Test.AllConstructors32[TYPE_REF]{AllConstructors32, test, Ltest.Test$AllConstructors32;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2545 |
"AllConstructors32b[CONSTRUCTOR_INVOCATION]{(), Ltest.Test$AllConstructors32b;, ()V, AllConstructors32b, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2546 |
" Test.AllConstructors32b[TYPE_REF]{AllConstructors32b, test, Ltest.Test$AllConstructors32b;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2547 |
"Test.AllConstructors32[TYPE_REF]{AllConstructors32, test, Ltest.Test$AllConstructors32;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
2548 |
requestor.getResults()); |
2549 |
} finally { |
2550 |
deleteProject("P"); |
2551 |
|
2552 |
JavaCore.setOptions(oldOptions); |
2553 |
} |
2554 |
} |
2555 |
public void testBug6930_33() throws Exception { |
2556 |
Hashtable oldOptions = JavaCore.getOptions(); |
2557 |
|
2558 |
try { |
2559 |
Hashtable options = new Hashtable(oldOptions); |
2560 |
options.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.ENABLED); |
2561 |
JavaCore.setOptions(options); |
2562 |
|
2563 |
IJavaProject p = createJavaProject("P", new String[] {"src"}, new String[]{"JCL_LIB"}, "bin"); |
2564 |
|
2565 |
createFolder("/P/src/p6930"); |
2566 |
createFolder("/P/src/p6930_1"); |
2567 |
createFolder("/P/src/p6930_2"); |
2568 |
|
2569 |
createFile( |
2570 |
"/P/src/p6930/AllConstructors33.java", |
2571 |
"package p6930;\n" + |
2572 |
"import p6930_2.ParamType;\n" + |
2573 |
"public class AllConstructors33 {\n" + |
2574 |
" public AllConstructors33(ParamType p11, ParamType p12) {}\n" + |
2575 |
" public AllConstructors33(p6930_1.ParamType p21, ParamType p22) {}\n" + |
2576 |
"}"); |
2577 |
|
2578 |
createFile( |
2579 |
"/P/src/p6930_1/ParamType.java", |
2580 |
"package p6930_1;\n" + |
2581 |
"public class ParamType {\n" + |
2582 |
"}"); |
2583 |
|
2584 |
createFile( |
2585 |
"/P/src/p6930_2/ParamType.java", |
2586 |
"package p6930_2;\n" + |
2587 |
"public class ParamType {\n" + |
2588 |
"}"); |
2589 |
|
2590 |
refresh(p); |
2591 |
|
2592 |
waitUntilIndexesReady(); |
2593 |
|
2594 |
this.workingCopies = new ICompilationUnit[1]; |
2595 |
this.workingCopies[0] = getWorkingCopy( |
2596 |
"/P/src/test/Test.java", |
2597 |
"package test;"+ |
2598 |
"public class Test {\n" + |
2599 |
" void foo() {\n" + |
2600 |
" new AllConstructors\n" + |
2601 |
" }\n" + |
2602 |
"}"); |
2603 |
|
2604 |
// do completion |
2605 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); |
2606 |
requestor.allowAllRequiredProposals(); |
2607 |
NullProgressMonitor monitor = new NullProgressMonitor(); |
2608 |
|
2609 |
String str = this.workingCopies[0].getSource(); |
2610 |
String completeBehind = "AllConstructors"; |
2611 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2612 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor); |
2613 |
|
2614 |
assertResults( |
2615 |
"AllConstructors33[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors33;, (Lp6930_1.ParamType;Lp6930_2.ParamType;)V, AllConstructors33, (p21, p22), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2616 |
" AllConstructors33[TYPE_REF]{p6930.AllConstructors33, p6930, Lp6930.AllConstructors33;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2617 |
"AllConstructors33[CONSTRUCTOR_INVOCATION]{(), Lp6930.AllConstructors33;, (Lp6930_1.ParamType;Lp6930_2.ParamType;)V, AllConstructors33, (p11, p12), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" + |
2618 |
" AllConstructors33[TYPE_REF]{p6930.AllConstructors33, p6930, Lp6930.AllConstructors33;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}", |
2619 |
requestor.getResults()); |
2620 |
} finally { |
2621 |
deleteProject("P"); |
2622 |
|
2623 |
JavaCore.setOptions(oldOptions); |
2624 |
} |
2625 |
} |
420 |
public void testBug79288() throws Exception { |
2626 |
public void testBug79288() throws Exception { |
421 |
try { |
2627 |
try { |
422 |
// create variable |
2628 |
// create variable |