Lines 90-100
Link Here
|
90 |
} |
90 |
} |
91 |
} |
91 |
} |
92 |
|
92 |
|
93 |
IJavaSearchScope getJavaSearchScopeBugs() { |
93 |
IJavaSearchScope getJavaSearchScope() { |
94 |
return SearchEngine.createJavaSearchScope(new IJavaProject[] {getJavaProject("JavaSearchBugs")}); |
94 |
return SearchEngine.createJavaSearchScope(new IJavaProject[] {getJavaProject("JavaSearchBugs")}); |
95 |
} |
95 |
} |
96 |
IJavaSearchScope getJavaSearchScopeBugs(String packageName, boolean addSubpackages) throws JavaModelException { |
96 |
IJavaSearchScope getJavaSearchScopeBugs(String packageName, boolean addSubpackages) throws JavaModelException { |
97 |
if (packageName == null) return getJavaSearchScopeBugs(); |
97 |
if (packageName == null) return getJavaSearchScope(); |
98 |
return getJavaSearchPackageScope("JavaSearchBugs", packageName, addSubpackages); |
98 |
return getJavaSearchPackageScope("JavaSearchBugs", packageName, addSubpackages); |
99 |
} |
99 |
} |
100 |
public ICompilationUnit getWorkingCopy(String path, String source) throws JavaModelException { |
100 |
public ICompilationUnit getWorkingCopy(String path, String source) throws JavaModelException { |
Lines 104-119
Link Here
|
104 |
return getWorkingCopy(path, source, this.wcOwner); |
104 |
return getWorkingCopy(path, source, this.wcOwner); |
105 |
} |
105 |
} |
106 |
protected void search(IJavaElement element, int limitTo) throws CoreException { |
106 |
protected void search(IJavaElement element, int limitTo) throws CoreException { |
107 |
search(element, limitTo, EXACT_RULE, getJavaSearchScopeBugs(), resultCollector); |
107 |
search(element, limitTo, EXACT_RULE, getJavaSearchScope(), resultCollector); |
108 |
} |
108 |
} |
109 |
protected void search(IJavaElement element, int limitTo, int matchRule) throws CoreException { |
109 |
protected void search(IJavaElement element, int limitTo, int matchRule) throws CoreException { |
110 |
search(element, limitTo, matchRule, getJavaSearchScopeBugs(), resultCollector); |
110 |
search(element, limitTo, matchRule, getJavaSearchScope(), resultCollector); |
111 |
} |
111 |
} |
112 |
protected void search(String patternString, int searchFor, int limitTo) throws CoreException { |
112 |
protected void search(String patternString, int searchFor, int limitTo) throws CoreException { |
113 |
search(patternString, searchFor, limitTo, EXACT_RULE, getJavaSearchScopeBugs(), resultCollector); |
113 |
search(patternString, searchFor, limitTo, EXACT_RULE, getJavaSearchScope(), resultCollector); |
114 |
} |
114 |
} |
115 |
protected void search(String patternString, int searchFor, int limitTo, int matchRule) throws CoreException { |
115 |
protected void search(String patternString, int searchFor, int limitTo, int matchRule) throws CoreException { |
116 |
search(patternString, searchFor, limitTo, matchRule, getJavaSearchScopeBugs(), resultCollector); |
116 |
search(patternString, searchFor, limitTo, matchRule, getJavaSearchScope(), resultCollector); |
117 |
} |
117 |
} |
118 |
/* (non-Javadoc) |
118 |
/* (non-Javadoc) |
119 |
* @see org.eclipse.jdt.core.tests.model.SuiteOfTestCases#setUpSuite() |
119 |
* @see org.eclipse.jdt.core.tests.model.SuiteOfTestCases#setUpSuite() |
Lines 2058-2064
Link Here
|
2058 |
new SearchEngine(workingCopies).search( |
2058 |
new SearchEngine(workingCopies).search( |
2059 |
pattern, |
2059 |
pattern, |
2060 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
2060 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
2061 |
getJavaSearchScopeBugs(), |
2061 |
getJavaSearchScope(), |
2062 |
resultCollector, |
2062 |
resultCollector, |
2063 |
null |
2063 |
null |
2064 |
); |
2064 |
); |
Lines 2086-2092
Link Here
|
2086 |
new SearchEngine(workingCopies).search( |
2086 |
new SearchEngine(workingCopies).search( |
2087 |
pattern, |
2087 |
pattern, |
2088 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
2088 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
2089 |
getJavaSearchScopeBugs(), |
2089 |
getJavaSearchScope(), |
2090 |
resultCollector, |
2090 |
resultCollector, |
2091 |
null |
2091 |
null |
2092 |
); |
2092 |
); |
Lines 2912-2918
Link Here
|
2912 |
IIndexConstants.ONE_STAR, |
2912 |
IIndexConstants.ONE_STAR, |
2913 |
SearchPattern.R_PATTERN_MATCH, // case insensitive |
2913 |
SearchPattern.R_PATTERN_MATCH, // case insensitive |
2914 |
TYPE, |
2914 |
TYPE, |
2915 |
getJavaSearchScopeBugs(), |
2915 |
getJavaSearchScope(), |
2916 |
requestor, |
2916 |
requestor, |
2917 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
2917 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
2918 |
null |
2918 |
null |
Lines 2942-2948
Link Here
|
2942 |
"*tion".toCharArray(), |
2942 |
"*tion".toCharArray(), |
2943 |
SearchPattern.R_PATTERN_MATCH, // case insensitive |
2943 |
SearchPattern.R_PATTERN_MATCH, // case insensitive |
2944 |
TYPE, |
2944 |
TYPE, |
2945 |
getJavaSearchScopeBugs(), |
2945 |
getJavaSearchScope(), |
2946 |
requestor, |
2946 |
requestor, |
2947 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
2947 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
2948 |
null |
2948 |
null |
Lines 2966-2972
Link Here
|
2966 |
IIndexConstants.ONE_STAR, |
2966 |
IIndexConstants.ONE_STAR, |
2967 |
SearchPattern.R_PATTERN_MATCH, // case insensitive |
2967 |
SearchPattern.R_PATTERN_MATCH, // case insensitive |
2968 |
TYPE, |
2968 |
TYPE, |
2969 |
getJavaSearchScopeBugs(), |
2969 |
getJavaSearchScope(), |
2970 |
requestor, |
2970 |
requestor, |
2971 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
2971 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
2972 |
null |
2972 |
null |
Lines 2994-3000
Link Here
|
2994 |
new char[] { 'X' }, |
2994 |
new char[] { 'X' }, |
2995 |
SearchPattern.R_PREFIX_MATCH, // case insensitive |
2995 |
SearchPattern.R_PREFIX_MATCH, // case insensitive |
2996 |
TYPE, |
2996 |
TYPE, |
2997 |
getJavaSearchScopeBugs(), |
2997 |
getJavaSearchScope(), |
2998 |
requestor, |
2998 |
requestor, |
2999 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
2999 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
3000 |
null |
3000 |
null |
Lines 3197-3203
Link Here
|
3197 |
); |
3197 |
); |
3198 |
IType type = selectType(workingCopies[0], "Annot"); |
3198 |
IType type = selectType(workingCopies[0], "Annot"); |
3199 |
IMethod method = type.getMethod("value", new String[0]); |
3199 |
IMethod method = type.getMethod("value", new String[0]); |
3200 |
search(method, REFERENCES, getJavaSearchScopeBugs(), collector); |
3200 |
search(method, REFERENCES, getJavaSearchScope(), collector); |
3201 |
assertSearchResults( |
3201 |
assertSearchResults( |
3202 |
"src/b93392/Test.java b93392.Test [41] EXACT_MATCH\n" + |
3202 |
"src/b93392/Test.java b93392.Test [41] EXACT_MATCH\n" + |
3203 |
"src/b93392/Test.java b93392.Test.bar [21] EXACT_MATCH\n" + |
3203 |
"src/b93392/Test.java b93392.Test.bar [21] EXACT_MATCH\n" + |
Lines 3272-3278
Link Here
|
3272 |
int methodsLength = methods.length; |
3272 |
int methodsLength = methods.length; |
3273 |
|
3273 |
|
3274 |
// Perform search on each duplicate method |
3274 |
// Perform search on each duplicate method |
3275 |
IJavaSearchScope scope = getJavaSearchScopeBugs(); |
3275 |
IJavaSearchScope scope = getJavaSearchScope(); |
3276 |
for (int m=0; m<methodsLength; m++) { |
3276 |
for (int m=0; m<methodsLength; m++) { |
3277 |
|
3277 |
|
3278 |
// Search method declaration |
3278 |
// Search method declaration |
Lines 3507-3513
Link Here
|
3507 |
// Verify matches |
3507 |
// Verify matches |
3508 |
TestCollector occurencesCollector = new TestCollector(); |
3508 |
TestCollector occurencesCollector = new TestCollector(); |
3509 |
occurencesCollector.showAccuracy = true; |
3509 |
occurencesCollector.showAccuracy = true; |
3510 |
search(type, ALL_OCCURRENCES, getJavaSearchScopeBugs(), occurencesCollector); |
3510 |
search(type, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3511 |
assertSearchResults( |
3511 |
assertSearchResults( |
3512 |
"src/b95794/Test.java [b95794.Test] EXACT_MATCH\n" + |
3512 |
"src/b95794/Test.java [b95794.Test] EXACT_MATCH\n" + |
3513 |
"src/b95794/Test.java [b95794.Test] EXACT_MATCH\n" + |
3513 |
"src/b95794/Test.java [b95794.Test] EXACT_MATCH\n" + |
Lines 3518-3524
Link Here
|
3518 |
|
3518 |
|
3519 |
// Verify with references matches |
3519 |
// Verify with references matches |
3520 |
TestCollector referencesCollector = new TestCollector(); |
3520 |
TestCollector referencesCollector = new TestCollector(); |
3521 |
search(type, REFERENCES, getJavaSearchScopeBugs(), referencesCollector); |
3521 |
search(type, REFERENCES, getJavaSearchScope(), referencesCollector); |
3522 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3522 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3523 |
} |
3523 |
} |
3524 |
public void testBug95794b() throws CoreException { |
3524 |
public void testBug95794b() throws CoreException { |
Lines 3529-3535
Link Here
|
3529 |
// Verify matches |
3529 |
// Verify matches |
3530 |
TestCollector occurencesCollector = new TestCollector(); |
3530 |
TestCollector occurencesCollector = new TestCollector(); |
3531 |
occurencesCollector.showAccuracy = true; |
3531 |
occurencesCollector.showAccuracy = true; |
3532 |
search(type, ALL_OCCURRENCES, getJavaSearchScopeBugs(), occurencesCollector); |
3532 |
search(type, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3533 |
assertSearchResults( |
3533 |
assertSearchResults( |
3534 |
"src/b95794/Test.java [b95794.Test.Color] EXACT_MATCH\n" + |
3534 |
"src/b95794/Test.java [b95794.Test.Color] EXACT_MATCH\n" + |
3535 |
"src/b95794/Test.java [b95794.Test.Color] EXACT_MATCH\n" + |
3535 |
"src/b95794/Test.java [b95794.Test.Color] EXACT_MATCH\n" + |
Lines 3540-3546
Link Here
|
3540 |
|
3540 |
|
3541 |
// Verify with references matches |
3541 |
// Verify with references matches |
3542 |
TestCollector referencesCollector = new TestCollector(); |
3542 |
TestCollector referencesCollector = new TestCollector(); |
3543 |
search(type, REFERENCES, getJavaSearchScopeBugs(), referencesCollector); |
3543 |
search(type, REFERENCES, getJavaSearchScope(), referencesCollector); |
3544 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3544 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3545 |
} |
3545 |
} |
3546 |
public void testBug95794c() throws CoreException { |
3546 |
public void testBug95794c() throws CoreException { |
Lines 3551-3557
Link Here
|
3551 |
// Verify matches |
3551 |
// Verify matches |
3552 |
TestCollector occurencesCollector = new TestCollector(); |
3552 |
TestCollector occurencesCollector = new TestCollector(); |
3553 |
occurencesCollector.showAccuracy = true; |
3553 |
occurencesCollector.showAccuracy = true; |
3554 |
search(field, ALL_OCCURRENCES, getJavaSearchScopeBugs(), occurencesCollector); |
3554 |
search(field, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3555 |
assertSearchResults( |
3555 |
assertSearchResults( |
3556 |
"src/b95794/Test.java [WHITE] EXACT_MATCH\n" + |
3556 |
"src/b95794/Test.java [WHITE] EXACT_MATCH\n" + |
3557 |
"src/b95794/Test.java void b95794.Test.main(String[]) [WHITE] EXACT_MATCH\n" + |
3557 |
"src/b95794/Test.java void b95794.Test.main(String[]) [WHITE] EXACT_MATCH\n" + |
Lines 3561-3567
Link Here
|
3561 |
|
3561 |
|
3562 |
// Verify with references matches |
3562 |
// Verify with references matches |
3563 |
TestCollector referencesCollector = new TestCollector(); |
3563 |
TestCollector referencesCollector = new TestCollector(); |
3564 |
search(field, REFERENCES, getJavaSearchScopeBugs(), referencesCollector); |
3564 |
search(field, REFERENCES, getJavaSearchScope(), referencesCollector); |
3565 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3565 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3566 |
} |
3566 |
} |
3567 |
|
3567 |
|
Lines 4710-4722
Link Here
|
4710 |
IMethod method = type.getMethod("subroutine", new String[] { "F" }); |
4710 |
IMethod method = type.getMethod("subroutine", new String[] { "F" }); |
4711 |
SearchPattern pattern = SearchPattern.createPattern(method, REFERENCES, EXACT_RULE); |
4711 |
SearchPattern pattern = SearchPattern.createPattern(method, REFERENCES, EXACT_RULE); |
4712 |
assertNotNull("Pattern should not be null", pattern); |
4712 |
assertNotNull("Pattern should not be null", pattern); |
4713 |
search(pattern, getJavaSearchScopeBugs(), resultCollector); |
4713 |
search(pattern, getJavaSearchScope(), resultCollector); |
4714 |
assertSearchResults( |
4714 |
assertSearchResults( |
4715 |
"src/b108088/B108088.java void b108088.B108088.doit(A108088, String) [subroutine(1.2f)] EXACT_MATCH" |
4715 |
"src/b108088/B108088.java void b108088.B108088.doit(A108088, String) [subroutine(1.2f)] EXACT_MATCH" |
4716 |
); |
4716 |
); |
4717 |
} |
4717 |
} |
4718 |
|
4718 |
|
4719 |
/** |
4719 |
/** |
|
|
4720 |
* Bug 109695: [search] Inaccurate search match for method invocations with literal arguments |
4721 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=109695" |
4722 |
*/ |
4723 |
public void testBug109695() throws CoreException { |
4724 |
workingCopies = new ICompilationUnit[1]; |
4725 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/IDocumentExtension.java", |
4726 |
"public interface IDocumentExtension {}\n" + |
4727 |
"interface IDocumentExtension2 {}\n" + |
4728 |
"interface IDocumentExtension3 {}\n" + |
4729 |
"interface IDocumentExtension135 {}\n" + |
4730 |
"interface IDocumentExtension315 {}\n" |
4731 |
); |
4732 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4733 |
searchAllTypeNames("IDE3", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4734 |
assertSearchResults( |
4735 |
"IDocumentExtension135\n" + |
4736 |
"IDocumentExtension3\n" + |
4737 |
"IDocumentExtension315", |
4738 |
requestor |
4739 |
); |
4740 |
} |
4741 |
public void testBug109695b() throws CoreException { |
4742 |
workingCopies = new ICompilationUnit[1]; |
4743 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/IDocumentProviderExtension.java", |
4744 |
"public interface IDocumentProviderExtension {}\n" + |
4745 |
"interface IDocumentProviderExtension2 {}\n" + |
4746 |
"interface IDocumentProviderExtension3 {}\n" + |
4747 |
"interface IDocumentProviderExtension4 {}\n" + |
4748 |
"interface IDocumentProviderExtension5 {}\n" + |
4749 |
"interface IDocumentProviderExtension12345 {}\n" + |
4750 |
"interface IDocumentProviderExtension54321 {}\n" |
4751 |
); |
4752 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4753 |
searchAllTypeNames("IDPE3", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4754 |
assertSearchResults( |
4755 |
"IDocumentProviderExtension12345\n" + |
4756 |
"IDocumentProviderExtension3\n" + |
4757 |
"IDocumentProviderExtension54321", |
4758 |
requestor |
4759 |
); |
4760 |
} |
4761 |
public void testBug109695c() throws CoreException { |
4762 |
workingCopies = new ICompilationUnit[1]; |
4763 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/IPerspectiveListener.java", |
4764 |
"public interface IPerspectiveListener {}\n" + |
4765 |
"interface IPerspectiveListener2 {}\n" + |
4766 |
"interface IPerspectiveListener3 {}\n" |
4767 |
); |
4768 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4769 |
searchAllTypeNames("IPL3", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4770 |
assertSearchResults( |
4771 |
"IPerspectiveListener3", |
4772 |
requestor |
4773 |
); |
4774 |
} |
4775 |
public void testBug109695d() throws CoreException { |
4776 |
workingCopies = new ICompilationUnit[1]; |
4777 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/IPropertySource.java", |
4778 |
"public interface IPropertySource {}\n" + |
4779 |
"interface IPropertySource2 {}\n" |
4780 |
); |
4781 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4782 |
searchAllTypeNames("IPS2", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4783 |
assertSearchResults( |
4784 |
"IPropertySource2", |
4785 |
requestor |
4786 |
); |
4787 |
} |
4788 |
public void testBug109695e() throws CoreException { |
4789 |
workingCopies = new ICompilationUnit[1]; |
4790 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/IWorkbenchWindowPulldownDelegate.java", |
4791 |
"public interface IWorkbenchWindowPulldownDelegate {}\n" + |
4792 |
"interface IWorkbenchWindowPulldownDelegate1 {}\n" + |
4793 |
"interface IWorkbenchWindowPulldownDelegate2 {}\n" + |
4794 |
"interface IWorkbenchWindowPulldownDelegate3 {}\n" + |
4795 |
"interface IWorkbenchWindowPulldownDelegate4 {}\n" |
4796 |
); |
4797 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4798 |
searchAllTypeNames("IWWPD2", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4799 |
assertSearchResults( |
4800 |
"IWorkbenchWindowPulldownDelegate2", |
4801 |
requestor |
4802 |
); |
4803 |
} |
4804 |
public void testBug109695f() throws CoreException { |
4805 |
workingCopies = new ICompilationUnit[1]; |
4806 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/UTF16DocumentScannerSupport.java", |
4807 |
"public class UTF16DocumentScannerSupport {}\n" + |
4808 |
"class UTF1DocScannerSupport {}\n" + |
4809 |
"class UTF6DocScannerSupport {}\n" + |
4810 |
"class UTFDocScannerSupport {}\n" |
4811 |
); |
4812 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4813 |
searchAllTypeNames("UTF16DSS", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4814 |
assertSearchResults( |
4815 |
"UTF16DocumentScannerSupport", |
4816 |
requestor |
4817 |
); |
4818 |
} |
4819 |
public void testBug109695g() throws CoreException { |
4820 |
workingCopies = new ICompilationUnit[1]; |
4821 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/UTF16DocumentScannerSupport.java", |
4822 |
"public class UTF16DocumentScannerSupport {}\n" + |
4823 |
"class UTF1DocScannerSupport {}\n" + |
4824 |
"class UTF6DocScannerSupport {}\n" + |
4825 |
"class UTFDocScannerSupport {}\n" |
4826 |
); |
4827 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4828 |
searchAllTypeNames("UTF1DSS", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4829 |
assertSearchResults( |
4830 |
"UTF16DocumentScannerSupport\n" + |
4831 |
"UTF1DocScannerSupport", |
4832 |
requestor |
4833 |
); |
4834 |
} |
4835 |
public void testBug109695h() throws CoreException { |
4836 |
workingCopies = new ICompilationUnit[1]; |
4837 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/UTF16DocumentScannerSupport.java", |
4838 |
"public class UTF16DocumentScannerSupport {}\n" + |
4839 |
"class UTF1DocScannerSupport {}\n" + |
4840 |
"class UTF6DocScannerSupport {}\n" + |
4841 |
"class UTFDocScannerSupport {}\n" |
4842 |
); |
4843 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4844 |
searchAllTypeNames("UTF6DSS", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4845 |
assertSearchResults( |
4846 |
"UTF16DocumentScannerSupport\n" + |
4847 |
"UTF6DocScannerSupport", |
4848 |
requestor |
4849 |
); |
4850 |
} |
4851 |
public void testBug109695i() throws CoreException { |
4852 |
workingCopies = new ICompilationUnit[1]; |
4853 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/UTF16DocumentScannerSupport.java", |
4854 |
"public class UTF16DocumentScannerSupport {}\n" + |
4855 |
"class UTF1DocScannerSupport {}\n" + |
4856 |
"class UTF6DocScannerSupport {}\n" + |
4857 |
"class UTFDocScannerSupport {}\n" |
4858 |
); |
4859 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
4860 |
searchAllTypeNames("UTFDSS", SearchPattern.R_CAMELCASE_MATCH, requestor); |
4861 |
assertSearchResults( |
4862 |
"UTF16DocumentScannerSupport\n" + |
4863 |
"UTF1DocScannerSupport\n" + |
4864 |
"UTF6DocScannerSupport\n" + |
4865 |
"UTFDocScannerSupport", |
4866 |
requestor |
4867 |
); |
4868 |
} |
4869 |
|
4870 |
/** |
4720 |
* To get these tests search matches in a workspace, do NOT forget to modify files |
4871 |
* To get these tests search matches in a workspace, do NOT forget to modify files |
4721 |
* to set them as working copies. |
4872 |
* to set them as working copies. |
4722 |
* |
4873 |
* |
Lines 4892-4898
Link Here
|
4892 |
"AA".toCharArray(), |
5043 |
"AA".toCharArray(), |
4893 |
SearchPattern.R_CAMELCASE_MATCH, |
5044 |
SearchPattern.R_CAMELCASE_MATCH, |
4894 |
TYPE, |
5045 |
TYPE, |
4895 |
getJavaSearchScopeBugs(), |
5046 |
getJavaSearchScope(), |
4896 |
requestor, |
5047 |
requestor, |
4897 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5048 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
4898 |
null |
5049 |
null |
Lines 4915-4921
Link Here
|
4915 |
"AA".toCharArray(), |
5066 |
"AA".toCharArray(), |
4916 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, |
5067 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, |
4917 |
TYPE, |
5068 |
TYPE, |
4918 |
getJavaSearchScopeBugs(), |
5069 |
getJavaSearchScope(), |
4919 |
requestor, |
5070 |
requestor, |
4920 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5071 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
4921 |
null |
5072 |
null |
Lines 4938-4944
Link Here
|
4938 |
"AA".toCharArray(), |
5089 |
"AA".toCharArray(), |
4939 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5090 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE, |
4940 |
TYPE, |
5091 |
TYPE, |
4941 |
getJavaSearchScopeBugs(), |
5092 |
getJavaSearchScope(), |
4942 |
requestor, |
5093 |
requestor, |
4943 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5094 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
4944 |
null |
5095 |
null |
Lines 4961-4967
Link Here
|
4961 |
"AA".toCharArray(), |
5112 |
"AA".toCharArray(), |
4962 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5113 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, |
4963 |
TYPE, |
5114 |
TYPE, |
4964 |
getJavaSearchScopeBugs(), |
5115 |
getJavaSearchScope(), |
4965 |
requestor, |
5116 |
requestor, |
4966 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5117 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
4967 |
null |
5118 |
null |
Lines 4984-4990
Link Here
|
4984 |
"AA".toCharArray(), |
5135 |
"AA".toCharArray(), |
4985 |
SearchPattern.R_PREFIX_MATCH, |
5136 |
SearchPattern.R_PREFIX_MATCH, |
4986 |
TYPE, |
5137 |
TYPE, |
4987 |
getJavaSearchScopeBugs(), |
5138 |
getJavaSearchScope(), |
4988 |
requestor, |
5139 |
requestor, |
4989 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5140 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
4990 |
null |
5141 |
null |
Lines 5005-5011
Link Here
|
5005 |
"AA".toCharArray(), |
5156 |
"AA".toCharArray(), |
5006 |
SearchPattern.R_CASE_SENSITIVE, |
5157 |
SearchPattern.R_CASE_SENSITIVE, |
5007 |
TYPE, |
5158 |
TYPE, |
5008 |
getJavaSearchScopeBugs(), |
5159 |
getJavaSearchScope(), |
5009 |
requestor, |
5160 |
requestor, |
5010 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5161 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5011 |
null |
5162 |
null |
Lines 5025-5031
Link Here
|
5025 |
"AA".toCharArray(), |
5176 |
"AA".toCharArray(), |
5026 |
SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5177 |
SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5027 |
TYPE, |
5178 |
TYPE, |
5028 |
getJavaSearchScopeBugs(), |
5179 |
getJavaSearchScope(), |
5029 |
requestor, |
5180 |
requestor, |
5030 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5181 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5031 |
null |
5182 |
null |
Lines 5046-5052
Link Here
|
5046 |
"aa".toCharArray(), |
5197 |
"aa".toCharArray(), |
5047 |
SearchPattern.R_CAMELCASE_MATCH, |
5198 |
SearchPattern.R_CAMELCASE_MATCH, |
5048 |
TYPE, |
5199 |
TYPE, |
5049 |
getJavaSearchScopeBugs(), |
5200 |
getJavaSearchScope(), |
5050 |
requestor, |
5201 |
requestor, |
5051 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5202 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5052 |
null |
5203 |
null |
Lines 5067-5073
Link Here
|
5067 |
"aa".toCharArray(), |
5218 |
"aa".toCharArray(), |
5068 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, |
5219 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH, |
5069 |
TYPE, |
5220 |
TYPE, |
5070 |
getJavaSearchScopeBugs(), |
5221 |
getJavaSearchScope(), |
5071 |
requestor, |
5222 |
requestor, |
5072 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5223 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5073 |
null |
5224 |
null |
Lines 5088-5094
Link Here
|
5088 |
"aa".toCharArray(), |
5239 |
"aa".toCharArray(), |
5089 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5240 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5090 |
TYPE, |
5241 |
TYPE, |
5091 |
getJavaSearchScopeBugs(), |
5242 |
getJavaSearchScope(), |
5092 |
requestor, |
5243 |
requestor, |
5093 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5244 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5094 |
null |
5245 |
null |
Lines 5108-5114
Link Here
|
5108 |
"aa".toCharArray(), |
5259 |
"aa".toCharArray(), |
5109 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5260 |
SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5110 |
TYPE, |
5261 |
TYPE, |
5111 |
getJavaSearchScopeBugs(), |
5262 |
getJavaSearchScope(), |
5112 |
requestor, |
5263 |
requestor, |
5113 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5264 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5114 |
null |
5265 |
null |
Lines 5128-5134
Link Here
|
5128 |
"aa".toCharArray(), |
5279 |
"aa".toCharArray(), |
5129 |
SearchPattern.R_PREFIX_MATCH, |
5280 |
SearchPattern.R_PREFIX_MATCH, |
5130 |
TYPE, |
5281 |
TYPE, |
5131 |
getJavaSearchScopeBugs(), |
5282 |
getJavaSearchScope(), |
5132 |
requestor, |
5283 |
requestor, |
5133 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5284 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5134 |
null |
5285 |
null |
Lines 5149-5155
Link Here
|
5149 |
"aa".toCharArray(), |
5300 |
"aa".toCharArray(), |
5150 |
SearchPattern.R_CASE_SENSITIVE, |
5301 |
SearchPattern.R_CASE_SENSITIVE, |
5151 |
TYPE, |
5302 |
TYPE, |
5152 |
getJavaSearchScopeBugs(), |
5303 |
getJavaSearchScope(), |
5153 |
requestor, |
5304 |
requestor, |
5154 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5305 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5155 |
null |
5306 |
null |
Lines 5169-5175
Link Here
|
5169 |
"aa".toCharArray(), |
5320 |
"aa".toCharArray(), |
5170 |
SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5321 |
SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE, |
5171 |
TYPE, |
5322 |
TYPE, |
5172 |
getJavaSearchScopeBugs(), |
5323 |
getJavaSearchScope(), |
5173 |
requestor, |
5324 |
requestor, |
5174 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5325 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
5175 |
null |
5326 |
null |
Lines 5506-5512
Link Here
|
5506 |
); |
5657 |
); |
5507 |
IType type = this.workingCopies[0].getType("Test"); |
5658 |
IType type = this.workingCopies[0].getType("Test"); |
5508 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5659 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5509 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector); |
5660 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
5510 |
assertSearchResults( |
5661 |
assertSearchResults( |
5511 |
"src/b110336/Test.java void b110336.Test.method(Class<Test>).TP [Test]\n" + |
5662 |
"src/b110336/Test.java void b110336.Test.method(Class<Test>).TP [Test]\n" + |
5512 |
"src/b110336/Test.java void b110336.Test.method(Class<Test>).clazz [Test]\n" + |
5663 |
"src/b110336/Test.java void b110336.Test.method(Class<Test>).clazz [Test]\n" + |
Lines 5534-5540
Link Here
|
5534 |
); |
5685 |
); |
5535 |
IType type = this.workingCopies[0].getType("Test"); |
5686 |
IType type = this.workingCopies[0].getType("Test"); |
5536 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5687 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5537 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector); |
5688 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
5538 |
assertSearchResults( |
5689 |
assertSearchResults( |
5539 |
"src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1 [Test]\n" + |
5690 |
"src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1 [Test]\n" + |
5540 |
"src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1.c [Test]\n" + |
5691 |
"src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1.c [Test]\n" + |
Lines 5558-5564
Link Here
|
5558 |
); |
5709 |
); |
5559 |
IType type = this.workingCopies[0].getType("X"); |
5710 |
IType type = this.workingCopies[0].getType("X"); |
5560 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5711 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5561 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector); |
5712 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
5562 |
assertSearchResults( |
5713 |
assertSearchResults( |
5563 |
"src/b110336/Test.java b110336.Test.TP [X]\n" + |
5714 |
"src/b110336/Test.java b110336.Test.TP [X]\n" + |
5564 |
"src/b110336/Test.java b110336.Test.x [X]", |
5715 |
"src/b110336/Test.java b110336.Test.x [X]", |
Lines 5577-5583
Link Here
|
5577 |
); |
5728 |
); |
5578 |
IType type = this.workingCopies[0].getType("Test"); |
5729 |
IType type = this.workingCopies[0].getType("Test"); |
5579 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5730 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5580 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector); |
5731 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
5581 |
assertSearchResults( |
5732 |
assertSearchResults( |
5582 |
"src/b110336/Test.java b110336.Test.a1Test [Test]+[b1Test,c1Test]\n" + |
5733 |
"src/b110336/Test.java b110336.Test.a1Test [Test]+[b1Test,c1Test]\n" + |
5583 |
"src/b110336/Test.java b110336.Test.b1Test [Test]\n" + |
5734 |
"src/b110336/Test.java b110336.Test.b1Test [Test]\n" + |
Lines 5602-5608
Link Here
|
5602 |
); |
5753 |
); |
5603 |
IType type = this.workingCopies[0].getType("Test"); |
5754 |
IType type = this.workingCopies[0].getType("Test"); |
5604 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5755 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5605 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector); |
5756 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
5606 |
assertSearchResults( |
5757 |
assertSearchResults( |
5607 |
"src/b110336/Test.java void b110336.Test.foo().lv1 [Test]+[lv2,lv3]\n" + |
5758 |
"src/b110336/Test.java void b110336.Test.foo().lv1 [Test]+[lv2,lv3]\n" + |
5608 |
"src/b110336/Test.java void b110336.Test.foo().lv2 [Test]\n" + |
5759 |
"src/b110336/Test.java void b110336.Test.foo().lv2 [Test]\n" + |
Lines 5632-5638
Link Here
|
5632 |
); |
5783 |
); |
5633 |
IType type = this.workingCopies[0].getType("Test"); |
5784 |
IType type = this.workingCopies[0].getType("Test"); |
5634 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5785 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5635 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector); |
5786 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
5636 |
assertSearchResults( |
5787 |
assertSearchResults( |
5637 |
"src/b110336/Test.java void b110336.Test.foo(Test).test1 [Test]\n" + |
5788 |
"src/b110336/Test.java void b110336.Test.foo(Test).test1 [Test]\n" + |
5638 |
"src/b110336/Test.java void b110336.Test.foo(Test).test2 [Test]\n" + |
5789 |
"src/b110336/Test.java void b110336.Test.foo(Test).test2 [Test]\n" + |
Lines 5656-5662
Link Here
|
5656 |
); |
5807 |
); |
5657 |
IType type = this.workingCopies[0].getType("Test"); |
5808 |
IType type = this.workingCopies[0].getType("Test"); |
5658 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5809 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5659 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector); |
5810 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
5660 |
assertSearchResults( |
5811 |
assertSearchResults( |
5661 |
"src/b110336/Test.java b110336.Test.{}.lv1 [Test]+[lv2,lv3]\n" + |
5812 |
"src/b110336/Test.java b110336.Test.{}.lv1 [Test]+[lv2,lv3]\n" + |
5662 |
"src/b110336/Test.java b110336.Test.{}.lv2 [Test]\n" + |
5813 |
"src/b110336/Test.java b110336.Test.{}.lv2 [Test]\n" + |
Lines 5681-5687
Link Here
|
5681 |
); |
5832 |
); |
5682 |
IType type = this.workingCopies[0].getType("Test"); |
5833 |
IType type = this.workingCopies[0].getType("Test"); |
5683 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5834 |
TypeReferencesCollector collector = new TypeReferencesCollector(); |
5684 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector); |
5835 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
5685 |
assertSearchResults( |
5836 |
assertSearchResults( |
5686 |
"src/b110336/Test.java b110336.Test.static {}.lv1 [Test]+[lv2,lv3]\n" + |
5837 |
"src/b110336/Test.java b110336.Test.static {}.lv1 [Test]+[lv2,lv3]\n" + |
5687 |
"src/b110336/Test.java b110336.Test.static {}.lv2 [Test]\n" + |
5838 |
"src/b110336/Test.java b110336.Test.static {}.lv2 [Test]\n" + |
Lines 5722-5728
Link Here
|
5722 |
CharOperation.NO_CHAR, |
5873 |
CharOperation.NO_CHAR, |
5723 |
SearchPattern.R_PREFIX_MATCH, |
5874 |
SearchPattern.R_PREFIX_MATCH, |
5724 |
IJavaSearchConstants.TYPE, |
5875 |
IJavaSearchConstants.TYPE, |
5725 |
getJavaSearchScopeBugs(), |
5876 |
getJavaSearchScope(), |
5726 |
requestor, |
5877 |
requestor, |
5727 |
WAIT_UNTIL_READY_TO_SEARCH, |
5878 |
WAIT_UNTIL_READY_TO_SEARCH, |
5728 |
null |
5879 |
null |
Lines 6239-6245
Link Here
|
6239 |
new SearchEngine(workingCopies).search( |
6390 |
new SearchEngine(workingCopies).search( |
6240 |
SearchPattern.createPattern(type, REFERENCES), |
6391 |
SearchPattern.createPattern(type, REFERENCES), |
6241 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
6392 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
6242 |
getJavaSearchScopeBugs(), |
6393 |
getJavaSearchScope(), |
6243 |
this.resultCollector, |
6394 |
this.resultCollector, |
6244 |
null |
6395 |
null |
6245 |
); |
6396 |
); |
Lines 6374-6380
Link Here
|
6374 |
null, |
6525 |
null, |
6375 |
SearchPattern.R_PATTERN_MATCH, // case insensitive |
6526 |
SearchPattern.R_PATTERN_MATCH, // case insensitive |
6376 |
TYPE, |
6527 |
TYPE, |
6377 |
getJavaSearchScopeBugs(), |
6528 |
getJavaSearchScope(), |
6378 |
requestor, |
6529 |
requestor, |
6379 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
6530 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
6380 |
null |
6531 |
null |
Lines 6827-6833
Link Here
|
6827 |
SearchPattern leftPattern = SearchPattern.createPattern(type1, IMPLEMENTORS); |
6978 |
SearchPattern leftPattern = SearchPattern.createPattern(type1, IMPLEMENTORS); |
6828 |
IType type2 = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_B.java").getType("I142044_B"); |
6979 |
IType type2 = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_B.java").getType("I142044_B"); |
6829 |
SearchPattern rightPattern = SearchPattern.createPattern(type2, IMPLEMENTORS); |
6980 |
SearchPattern rightPattern = SearchPattern.createPattern(type2, IMPLEMENTORS); |
6830 |
search(SearchPattern.createAndPattern(leftPattern, rightPattern), getJavaSearchScopeBugs(), this.resultCollector); |
6981 |
search(SearchPattern.createAndPattern(leftPattern, rightPattern), getJavaSearchScope(), this.resultCollector); |
6831 |
assertSearchResults(""); |
6982 |
assertSearchResults(""); |
6832 |
} |
6983 |
} |
6833 |
/** |
6984 |
/** |
Lines 6838-6844
Link Here
|
6838 |
SearchPattern leftPattern = SearchPattern.createPattern(type1, IMPLEMENTORS); |
6989 |
SearchPattern leftPattern = SearchPattern.createPattern(type1, IMPLEMENTORS); |
6839 |
IType type2 = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_A.java").getType("I142044_A"); |
6990 |
IType type2 = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_A.java").getType("I142044_A"); |
6840 |
SearchPattern rightPattern = SearchPattern.createPattern(type2, IMPLEMENTORS); |
6991 |
SearchPattern rightPattern = SearchPattern.createPattern(type2, IMPLEMENTORS); |
6841 |
search(SearchPattern.createAndPattern(leftPattern, rightPattern), getJavaSearchScopeBugs(), this.resultCollector); |
6992 |
search(SearchPattern.createAndPattern(leftPattern, rightPattern), getJavaSearchScope(), this.resultCollector); |
6842 |
assertSearchResults( |
6993 |
assertSearchResults( |
6843 |
"src/b142044/X142044.java b142044.X142044$XX1 [I142044_A] EXACT_MATCH\n" + |
6994 |
"src/b142044/X142044.java b142044.X142044$XX1 [I142044_A] EXACT_MATCH\n" + |
6844 |
"src/b142044/X142044.java b142044.X142044$XX12 [I142044_A] EXACT_MATCH\n" + |
6995 |
"src/b142044/X142044.java b142044.X142044$XX12 [I142044_A] EXACT_MATCH\n" + |
Lines 6853-6859
Link Here
|
6853 |
SearchPattern leftPattern = createPattern("X*", CLASS, DECLARATIONS, true); |
7004 |
SearchPattern leftPattern = createPattern("X*", CLASS, DECLARATIONS, true); |
6854 |
IType iType = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_A.java").getType("I142044_A"); |
7005 |
IType iType = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_A.java").getType("I142044_A"); |
6855 |
SearchPattern rightPattern = SearchPattern.createPattern(iType, IMPLEMENTORS); |
7006 |
SearchPattern rightPattern = SearchPattern.createPattern(iType, IMPLEMENTORS); |
6856 |
search(SearchPattern.createAndPattern(leftPattern, rightPattern), getJavaSearchScopeBugs(), this.resultCollector); |
7007 |
search(SearchPattern.createAndPattern(leftPattern, rightPattern), getJavaSearchScope(), this.resultCollector); |
6857 |
assertSearchResults(""); // currently no results as only same kind of pattern are ANDoable... |
7008 |
assertSearchResults(""); // currently no results as only same kind of pattern are ANDoable... |
6858 |
} |
7009 |
} |
6859 |
/** |
7010 |
/** |
Lines 6863-6869
Link Here
|
6863 |
IType type1 = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_A.java").getType("I142044_A"); |
7014 |
IType type1 = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_A.java").getType("I142044_A"); |
6864 |
SearchPattern leftPattern = SearchPattern.createPattern(type1, IMPLEMENTORS); |
7015 |
SearchPattern leftPattern = SearchPattern.createPattern(type1, IMPLEMENTORS); |
6865 |
SearchPattern rightPattern = createPattern("I*", CLASS, IMPLEMENTORS, true); |
7016 |
SearchPattern rightPattern = createPattern("I*", CLASS, IMPLEMENTORS, true); |
6866 |
search(SearchPattern.createAndPattern(leftPattern, rightPattern), getJavaSearchScopeBugs(), this.resultCollector); |
7017 |
search(SearchPattern.createAndPattern(leftPattern, rightPattern), getJavaSearchScope(), this.resultCollector); |
6867 |
assertSearchResults( |
7018 |
assertSearchResults( |
6868 |
"src/b142044/X142044.java b142044.X142044$XX1 [I142044_A] EXACT_MATCH\n" + |
7019 |
"src/b142044/X142044.java b142044.X142044$XX1 [I142044_A] EXACT_MATCH\n" + |
6869 |
"src/b142044/X142044.java b142044.X142044$XX12 [I142044_A] EXACT_MATCH\n" + |
7020 |
"src/b142044/X142044.java b142044.X142044$XX12 [I142044_A] EXACT_MATCH\n" + |
Lines 6879-6885
Link Here
|
6879 |
SearchPattern leftPattern = SearchPattern.createPattern(type1, IMPLEMENTORS); |
7030 |
SearchPattern leftPattern = SearchPattern.createPattern(type1, IMPLEMENTORS); |
6880 |
IType type2 = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_B.java").getType("I142044_B"); |
7031 |
IType type2 = getCompilationUnit("JavaSearchBugs", "src", "b142044", "I142044_B.java").getType("I142044_B"); |
6881 |
SearchPattern rightPattern = SearchPattern.createPattern(type2, IMPLEMENTORS); |
7032 |
SearchPattern rightPattern = SearchPattern.createPattern(type2, IMPLEMENTORS); |
6882 |
search(SearchPattern.createOrPattern(leftPattern, rightPattern), getJavaSearchScopeBugs(), this.resultCollector); |
7033 |
search(SearchPattern.createOrPattern(leftPattern, rightPattern), getJavaSearchScope(), this.resultCollector); |
6883 |
assertSearchResults( |
7034 |
assertSearchResults( |
6884 |
"src/b142044/X142044.java b142044.X142044$XX1 [I142044_A] EXACT_MATCH\n" + |
7035 |
"src/b142044/X142044.java b142044.X142044$XX1 [I142044_A] EXACT_MATCH\n" + |
6885 |
"src/b142044/X142044.java b142044.X142044$XX2 [I142044_B] EXACT_MATCH\n" + |
7036 |
"src/b142044/X142044.java b142044.X142044$XX2 [I142044_B] EXACT_MATCH\n" + |
Lines 7034-7040
Link Here
|
7034 |
"package b148380;\n" + |
7185 |
"package b148380;\n" + |
7035 |
"public class Y {}\n" |
7186 |
"public class Y {}\n" |
7036 |
); |
7187 |
); |
7037 |
IJavaSearchScope scope = getJavaSearchScopeBugs(); |
7188 |
IJavaSearchScope scope = getJavaSearchScope(); |
7038 |
TypeNameMatchCollector requestor1 = new TypeNameMatchCollector(); |
7189 |
TypeNameMatchCollector requestor1 = new TypeNameMatchCollector(); |
7039 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
7190 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
7040 |
"b148380".toCharArray(), |
7191 |
"b148380".toCharArray(), |
Lines 7066-7072
Link Here
|
7066 |
assertSearchResults(expected, requestor2); |
7217 |
assertSearchResults(expected, requestor2); |
7067 |
} |
7218 |
} |
7068 |
public void testBug148380_SearchAllTypes_cu() throws CoreException, JavaModelException { |
7219 |
public void testBug148380_SearchAllTypes_cu() throws CoreException, JavaModelException { |
7069 |
IJavaSearchScope scope = getJavaSearchScopeBugs(); |
7220 |
IJavaSearchScope scope = getJavaSearchScope(); |
7070 |
TypeNameMatchCollector requestor = new TypeNameMatchCollector(); |
7221 |
TypeNameMatchCollector requestor = new TypeNameMatchCollector(); |
7071 |
new SearchEngine().searchAllTypeNames( |
7222 |
new SearchEngine().searchAllTypeNames( |
7072 |
null, |
7223 |
null, |
Lines 7529-7535
Link Here
|
7529 |
null, |
7680 |
null, |
7530 |
SearchPattern.R_PREFIX_MATCH, |
7681 |
SearchPattern.R_PREFIX_MATCH, |
7531 |
IJavaSearchConstants.TYPE, |
7682 |
IJavaSearchConstants.TYPE, |
7532 |
getJavaSearchScopeBugs(), |
7683 |
getJavaSearchScope(), |
7533 |
collector, |
7684 |
collector, |
7534 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7685 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7535 |
null); |
7686 |
null); |
Lines 7541-7547
Link Here
|
7541 |
null, |
7692 |
null, |
7542 |
SearchPattern.R_PREFIX_MATCH, |
7693 |
SearchPattern.R_PREFIX_MATCH, |
7543 |
IJavaSearchConstants.TYPE, |
7694 |
IJavaSearchConstants.TYPE, |
7544 |
getJavaSearchScopeBugs(), |
7695 |
getJavaSearchScope(), |
7545 |
requestor, |
7696 |
requestor, |
7546 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7697 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7547 |
null); |
7698 |
null); |
Lines 7567-7573
Link Here
|
7567 |
new SearchEngine().searchAllTypeNames( |
7718 |
new SearchEngine().searchAllTypeNames( |
7568 |
null, |
7719 |
null, |
7569 |
null, |
7720 |
null, |
7570 |
getJavaSearchScopeBugs(), |
7721 |
getJavaSearchScope(), |
7571 |
collector, |
7722 |
collector, |
7572 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7723 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7573 |
null); |
7724 |
null); |
Lines 7576-7582
Link Here
|
7576 |
new SearchEngine().searchAllTypeNames( |
7727 |
new SearchEngine().searchAllTypeNames( |
7577 |
null, |
7728 |
null, |
7578 |
null, |
7729 |
null, |
7579 |
getJavaSearchScopeBugs(), |
7730 |
getJavaSearchScope(), |
7580 |
requestor, |
7731 |
requestor, |
7581 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7732 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7582 |
null); |
7733 |
null); |
Lines 7595-7601
Link Here
|
7595 |
new SearchEngine().searchAllTypeNames( |
7746 |
new SearchEngine().searchAllTypeNames( |
7596 |
null, |
7747 |
null, |
7597 |
new char[][] { "Test".toCharArray() }, |
7748 |
new char[][] { "Test".toCharArray() }, |
7598 |
getJavaSearchScopeBugs(), |
7749 |
getJavaSearchScope(), |
7599 |
collector, |
7750 |
collector, |
7600 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7751 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7601 |
null); |
7752 |
null); |
Lines 7604-7610
Link Here
|
7604 |
new SearchEngine().searchAllTypeNames( |
7755 |
new SearchEngine().searchAllTypeNames( |
7605 |
null, |
7756 |
null, |
7606 |
new char[][] { "Test".toCharArray() }, |
7757 |
new char[][] { "Test".toCharArray() }, |
7607 |
getJavaSearchScopeBugs(), |
7758 |
getJavaSearchScope(), |
7608 |
requestor, |
7759 |
requestor, |
7609 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7760 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7610 |
null); |
7761 |
null); |
Lines 7642-7648
Link Here
|
7642 |
new SearchEngine().searchAllTypeNames( |
7793 |
new SearchEngine().searchAllTypeNames( |
7643 |
packagesList, |
7794 |
packagesList, |
7644 |
typesList, |
7795 |
typesList, |
7645 |
getJavaSearchScopeBugs(), |
7796 |
getJavaSearchScope(), |
7646 |
collector, |
7797 |
collector, |
7647 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7798 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7648 |
null); |
7799 |
null); |
Lines 7652-7658
Link Here
|
7652 |
new SearchEngine().searchAllTypeNames( |
7803 |
new SearchEngine().searchAllTypeNames( |
7653 |
packagesList, |
7804 |
packagesList, |
7654 |
typesList, |
7805 |
typesList, |
7655 |
getJavaSearchScopeBugs(), |
7806 |
getJavaSearchScope(), |
7656 |
requestor, |
7807 |
requestor, |
7657 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7808 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7658 |
null); |
7809 |
null); |
Lines 7680-7686
Link Here
|
7680 |
new SearchEngine().searchAllTypeNames( |
7831 |
new SearchEngine().searchAllTypeNames( |
7681 |
packagesList, |
7832 |
packagesList, |
7682 |
null, |
7833 |
null, |
7683 |
getJavaSearchScopeBugs(), |
7834 |
getJavaSearchScope(), |
7684 |
collector, |
7835 |
collector, |
7685 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7836 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7686 |
null); |
7837 |
null); |
Lines 7689-7695
Link Here
|
7689 |
new SearchEngine().searchAllTypeNames( |
7840 |
new SearchEngine().searchAllTypeNames( |
7690 |
packagesList, |
7841 |
packagesList, |
7691 |
null, |
7842 |
null, |
7692 |
getJavaSearchScopeBugs(), |
7843 |
getJavaSearchScope(), |
7693 |
requestor, |
7844 |
requestor, |
7694 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7845 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7695 |
null); |
7846 |
null); |
Lines 7749-7755
Link Here
|
7749 |
new SearchEngine().searchAllTypeNames( |
7900 |
new SearchEngine().searchAllTypeNames( |
7750 |
packagesList, |
7901 |
packagesList, |
7751 |
null, |
7902 |
null, |
7752 |
getJavaSearchScopeBugs(), |
7903 |
getJavaSearchScope(), |
7753 |
collector, |
7904 |
collector, |
7754 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7905 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7755 |
null); |
7906 |
null); |
Lines 7758-7764
Link Here
|
7758 |
new SearchEngine().searchAllTypeNames( |
7909 |
new SearchEngine().searchAllTypeNames( |
7759 |
packagesList, |
7910 |
packagesList, |
7760 |
null, |
7911 |
null, |
7761 |
getJavaSearchScopeBugs(), |
7912 |
getJavaSearchScope(), |
7762 |
requestor, |
7913 |
requestor, |
7763 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7914 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7764 |
null); |
7915 |
null); |
Lines 7867-7873
Link Here
|
7867 |
} |
8018 |
} |
7868 |
}; |
8019 |
}; |
7869 |
collector.showAccuracy = true; |
8020 |
collector.showAccuracy = true; |
7870 |
search(type, REFERENCES, getJavaSearchScopeBugs(), collector); |
8021 |
search(type, REFERENCES, getJavaSearchScope(), collector); |
7871 |
assertSearchResults( |
8022 |
assertSearchResults( |
7872 |
"lib/b164791.jar test.<anonymous> EXACT_MATCH\n" + |
8023 |
"lib/b164791.jar test.<anonymous> EXACT_MATCH\n" + |
7873 |
"lib/b164791.jar test.<anonymous> EXACT_MATCH", |
8024 |
"lib/b164791.jar test.<anonymous> EXACT_MATCH", |
Lines 7901-7907
Link Here
|
7901 |
*/ |
8052 |
*/ |
7902 |
public void testBug167190() throws CoreException, JavaModelException { |
8053 |
public void testBug167190() throws CoreException, JavaModelException { |
7903 |
IJavaSearchScope scope = new AbstractSearchScope() { |
8054 |
IJavaSearchScope scope = new AbstractSearchScope() { |
7904 |
IJavaSearchScope jsScope = getJavaSearchScopeBugs(); |
8055 |
IJavaSearchScope jsScope = getJavaSearchScope(); |
7905 |
public void processDelta(IJavaElementDelta delta) { |
8056 |
public void processDelta(IJavaElementDelta delta) { |
7906 |
// we should have no delta on this test case |
8057 |
// we should have no delta on this test case |
7907 |
} |
8058 |
} |
Lines 8296-8302
Link Here
|
8296 |
} |
8447 |
} |
8297 |
|
8448 |
|
8298 |
}; |
8449 |
}; |
8299 |
search("Foo196339", IJavaSearchConstants.TYPE, IJavaSearchConstants.IMPLEMENTORS, getJavaSearchScopeBugs(), collector); |
8450 |
search("Foo196339", IJavaSearchConstants.TYPE, IJavaSearchConstants.IMPLEMENTORS, getJavaSearchScope(), collector); |
8300 |
assertSearchResults( |
8451 |
assertSearchResults( |
8301 |
"src/b196339/x/y/z/Test1.java b196339.x.y.z.Test1 [Foo196339]\n" + |
8452 |
"src/b196339/x/y/z/Test1.java b196339.x.y.z.Test1 [Foo196339]\n" + |
8302 |
"src/b196339/x/y/z/Test2.java b196339.x.y.z.Test2 [Foo196339]\n" + |
8453 |
"src/b196339/x/y/z/Test2.java b196339.x.y.z.Test2 [Foo196339]\n" + |