Lines 37-44
Link Here
|
37 |
import org.eclipse.jdt.internal.core.index.Index; |
37 |
import org.eclipse.jdt.internal.core.index.Index; |
38 |
import org.eclipse.jdt.internal.core.search.AbstractSearchScope; |
38 |
import org.eclipse.jdt.internal.core.search.AbstractSearchScope; |
39 |
import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants; |
39 |
import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants; |
40 |
import org.eclipse.jdt.internal.core.search.matching.AndPattern; |
|
|
41 |
import org.eclipse.jdt.internal.core.search.indexing.IndexManager; |
40 |
import org.eclipse.jdt.internal.core.search.indexing.IndexManager; |
|
|
41 |
import org.eclipse.jdt.internal.core.search.matching.AndPattern; |
42 |
import org.eclipse.jdt.internal.core.search.matching.MatchLocator; |
42 |
import org.eclipse.jdt.internal.core.search.matching.MatchLocator; |
43 |
import org.eclipse.jdt.internal.core.search.matching.PatternLocator; |
43 |
import org.eclipse.jdt.internal.core.search.matching.PatternLocator; |
44 |
import org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern; |
44 |
import org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern; |
Lines 57-62
Link Here
|
57 |
return buildModelTestSuite(JavaSearchBugsTests.class); |
57 |
return buildModelTestSuite(JavaSearchBugsTests.class); |
58 |
} |
58 |
} |
59 |
static { |
59 |
static { |
|
|
60 |
// org.eclipse.jdt.internal.core.search.processing.JobManager.VERBOSE = true; |
60 |
// org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true; |
61 |
// org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true; |
61 |
// org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true; |
62 |
// org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true; |
62 |
} |
63 |
} |
Lines 130-137
Link Here
|
130 |
protected void setUp () throws Exception { |
131 |
protected void setUp () throws Exception { |
131 |
super.setUp(); |
132 |
super.setUp(); |
132 |
this.resultCollector = new TestCollector(); |
133 |
this.resultCollector = new TestCollector(); |
133 |
this.resultCollector.showInsideDoc = false; |
134 |
this.resultCollector.showAccuracy(true); |
134 |
this.resultCollector.showAccuracy = true; |
135 |
} |
|
|
136 |
|
137 |
/** |
138 |
* @bug 12044: [search] Reference to package is not found in qualified annotation |
139 |
* @test Ensure that references to package are also found in qualified annotation |
140 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=12044" |
141 |
*/ |
142 |
private String[] sourcesBug12044() throws CoreException { |
143 |
return new String[] { |
144 |
"Def.java", |
145 |
"public class Def {\n" + |
146 |
" public static final int ONE = 1;\n" + |
147 |
" public static final int TWO = 2;\n" + |
148 |
" public static final int THREE = 3;\n" + |
149 |
"}\n", |
150 |
"Ref.java", |
151 |
"public class Ref {\n" + |
152 |
" class Sub {\n" + |
153 |
" int x = Def.ONE;\n" + |
154 |
" int getX() {\n" + |
155 |
" return x;\n" + |
156 |
" }\n" + |
157 |
" }\n" + |
158 |
" void foo(Sub sub) {\n" + |
159 |
" switch (sub.getX()) {\n" + |
160 |
" case Def.ONE:\n" + |
161 |
" break;\n" + |
162 |
" case Def.TWO:\n" + |
163 |
" break;\n" + |
164 |
" case Def.THREE:\n" + |
165 |
" break;\n" + |
166 |
" }\n" + |
167 |
" }\n" + |
168 |
"}\n" |
169 |
}; |
170 |
} |
171 |
static { TESTS_PREFIX = "testBug12044"; } |
172 |
public void testBug12044_no_src() throws CoreException, IOException { |
173 |
IJavaProject javaProject = null; |
174 |
try { |
175 |
javaProject = createJavaProject("b012044", new String[] { "src" }, new String[] {"JCL_LIB" }, "bin"); |
176 |
waitUntilIndexesReady(); |
177 |
String jarPath = getWorkspacePath()+"b012044"+File.separator+"b012044.jar"; |
178 |
createJar(sourcesBug12044(), jarPath); |
179 |
refresh(javaProject); |
180 |
String resourcePath = "/b012044/b012044.jar"; |
181 |
addLibraryEntry(javaProject, resourcePath); |
182 |
waitUntilIndexesReady(); |
183 |
IClassFile classFile = getClassFile("b012044", resourcePath, "", "Def.class"); |
184 |
IField field = classFile.getType().getField("ONE"); |
185 |
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { javaProject } ); |
186 |
this.resultCollector.showJarFile(); |
187 |
search(field, ALL_OCCURRENCES, scope); |
188 |
assertSearchResults( |
189 |
"b012044.jar|Def.class Def.ONE [No source] EXACT_MATCH" |
190 |
); |
191 |
} |
192 |
finally { |
193 |
if (javaProject != null) { |
194 |
deleteProject(javaProject); |
195 |
} |
196 |
} |
197 |
} |
198 |
public void testBug12044_src_in_zip() throws CoreException, IOException { |
199 |
IJavaProject javaProject = null; |
200 |
try { |
201 |
javaProject = createJavaProject("b012044", new String[] { "src" }, new String[] {"JCL_LIB" }, "bin"); |
202 |
waitUntilIndexesReady(); |
203 |
String path = getWorkspacePath()+"b012044"+File.separator+"b012044"; |
204 |
String jarPath = path+".jar"; |
205 |
createJar(sourcesBug12044(), jarPath); |
206 |
String zipPath = path+".zip"; |
207 |
Util.createSourceZip(sourcesBug12044(), zipPath); |
208 |
refresh(javaProject); |
209 |
String resourcePath = "/b012044/b012044.jar"; |
210 |
String resourceZipPath = "/b012044/b012044.zip"; |
211 |
addLibraryEntry(javaProject, resourcePath, resourceZipPath); |
212 |
waitUntilIndexesReady(); |
213 |
IClassFile classFile = getClassFile("b012044", resourcePath, "", "Def.class"); |
214 |
IField field = classFile.getType().getField("ONE"); |
215 |
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { javaProject } ); |
216 |
this.resultCollector.showJarFile(); |
217 |
search(field, ALL_OCCURRENCES, scope); |
218 |
assertSearchResults( |
219 |
"b012044.jar|Def.class Def.ONE EXACT_MATCH\n" + |
220 |
"b012044.jar|Ref.class void Ref.foo(Ref.Sub) EXACT_MATCH\n" + |
221 |
"b012044.jar|Ref$Sub.class Ref$Sub.x EXACT_MATCH" |
222 |
); |
223 |
} |
224 |
finally { |
225 |
if (javaProject != null) { |
226 |
deleteProject(javaProject); |
227 |
} |
228 |
} |
135 |
} |
229 |
} |
136 |
|
230 |
|
137 |
/** |
231 |
/** |
Lines 775-781
Link Here
|
775 |
); |
869 |
); |
776 |
} |
870 |
} |
777 |
public void testBug79378b() throws CoreException { |
871 |
public void testBug79378b() throws CoreException { |
778 |
this.resultCollector.showRule = true; |
872 |
this.resultCollector.showRule(); |
779 |
this.workingCopies = new ICompilationUnit[1]; |
873 |
this.workingCopies = new ICompilationUnit[1]; |
780 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79378/A.java", |
874 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79378/A.java", |
781 |
"package b79378;\n" + |
875 |
"package b79378;\n" + |
Lines 1491-1497
Link Here
|
1491 |
); |
1585 |
); |
1492 |
} |
1586 |
} |
1493 |
public void testBug82208_TYPE() throws CoreException { |
1587 |
public void testBug82208_TYPE() throws CoreException { |
1494 |
this.resultCollector.showRule = true; |
1588 |
this.resultCollector.showRule(); |
1495 |
setUpBug82208(); |
1589 |
setUpBug82208(); |
1496 |
search("B82208*", TYPE, ALL_OCCURRENCES); |
1590 |
search("B82208*", TYPE, ALL_OCCURRENCES); |
1497 |
assertSearchResults( |
1591 |
assertSearchResults( |
Lines 1502-1508
Link Here
|
1502 |
); |
1596 |
); |
1503 |
} |
1597 |
} |
1504 |
public void testBug82208_CLASS() throws CoreException { |
1598 |
public void testBug82208_CLASS() throws CoreException { |
1505 |
this.resultCollector.showRule = true; |
1599 |
this.resultCollector.showRule(); |
1506 |
setUpBug82208(); |
1600 |
setUpBug82208(); |
1507 |
search("B82208*", CLASS, ALL_OCCURRENCES); |
1601 |
search("B82208*", CLASS, ALL_OCCURRENCES); |
1508 |
assertSearchResults( |
1602 |
assertSearchResults( |
Lines 1510-1516
Link Here
|
1510 |
); |
1604 |
); |
1511 |
} |
1605 |
} |
1512 |
public void testBug82208_INTERFACE() throws CoreException { |
1606 |
public void testBug82208_INTERFACE() throws CoreException { |
1513 |
this.resultCollector.showRule = true; |
1607 |
this.resultCollector.showRule(); |
1514 |
setUpBug82208(); |
1608 |
setUpBug82208(); |
1515 |
search("B82208*", INTERFACE, ALL_OCCURRENCES); |
1609 |
search("B82208*", INTERFACE, ALL_OCCURRENCES); |
1516 |
assertSearchResults( |
1610 |
assertSearchResults( |
Lines 1518-1524
Link Here
|
1518 |
); |
1612 |
); |
1519 |
} |
1613 |
} |
1520 |
public void testBug82208_ENUM() throws CoreException { |
1614 |
public void testBug82208_ENUM() throws CoreException { |
1521 |
this.resultCollector.showRule = true; |
1615 |
this.resultCollector.showRule(); |
1522 |
setUpBug82208(); |
1616 |
setUpBug82208(); |
1523 |
search("B82208*", ENUM, ALL_OCCURRENCES); |
1617 |
search("B82208*", ENUM, ALL_OCCURRENCES); |
1524 |
assertSearchResults( |
1618 |
assertSearchResults( |
Lines 1526-1532
Link Here
|
1526 |
); |
1620 |
); |
1527 |
} |
1621 |
} |
1528 |
public void testBug82208_ANNOTATION_TYPE() throws CoreException { |
1622 |
public void testBug82208_ANNOTATION_TYPE() throws CoreException { |
1529 |
this.resultCollector.showRule = true; |
1623 |
this.resultCollector.showRule(); |
1530 |
setUpBug82208(); |
1624 |
setUpBug82208(); |
1531 |
search("B82208*", ANNOTATION_TYPE, ALL_OCCURRENCES); |
1625 |
search("B82208*", ANNOTATION_TYPE, ALL_OCCURRENCES); |
1532 |
assertSearchResults( |
1626 |
assertSearchResults( |
Lines 1534-1540
Link Here
|
1534 |
); |
1628 |
); |
1535 |
} |
1629 |
} |
1536 |
public void testBug82208_CLASS_AND_INTERFACE() throws CoreException { |
1630 |
public void testBug82208_CLASS_AND_INTERFACE() throws CoreException { |
1537 |
this.resultCollector.showRule = true; |
1631 |
this.resultCollector.showRule(); |
1538 |
setUpBug82208(); |
1632 |
setUpBug82208(); |
1539 |
search("B82208*", CLASS_AND_INTERFACE, ALL_OCCURRENCES); |
1633 |
search("B82208*", CLASS_AND_INTERFACE, ALL_OCCURRENCES); |
1540 |
assertSearchResults( |
1634 |
assertSearchResults( |
Lines 1543-1549
Link Here
|
1543 |
); |
1637 |
); |
1544 |
} |
1638 |
} |
1545 |
public void testBug82208_CLASS_AND_ENUMERATION() throws CoreException { |
1639 |
public void testBug82208_CLASS_AND_ENUMERATION() throws CoreException { |
1546 |
this.resultCollector.showRule = true; |
1640 |
this.resultCollector.showRule(); |
1547 |
setUpBug82208(); |
1641 |
setUpBug82208(); |
1548 |
search("B82208*", CLASS_AND_ENUM, ALL_OCCURRENCES); |
1642 |
search("B82208*", CLASS_AND_ENUM, ALL_OCCURRENCES); |
1549 |
assertSearchResults( |
1643 |
assertSearchResults( |
Lines 1557-1563
Link Here
|
1557 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83012" |
1651 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83012" |
1558 |
*/ |
1652 |
*/ |
1559 |
public void testBug82673() throws CoreException { |
1653 |
public void testBug82673() throws CoreException { |
1560 |
this.resultCollector.showRule = true; |
1654 |
this.resultCollector.showRule(); |
1561 |
this.workingCopies = new ICompilationUnit[1]; |
1655 |
this.workingCopies = new ICompilationUnit[1]; |
1562 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b82673/Test.java", |
1656 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b82673/Test.java", |
1563 |
"package b82673;\n" + |
1657 |
"package b82673;\n" + |
Lines 1590-1596
Link Here
|
1590 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83012" |
1684 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83012" |
1591 |
*/ |
1685 |
*/ |
1592 |
public void testBug83012() throws CoreException { |
1686 |
public void testBug83012() throws CoreException { |
1593 |
this.resultCollector.showRule = true; |
1687 |
this.resultCollector.showRule(); |
1594 |
this.workingCopies = new ICompilationUnit[1]; |
1688 |
this.workingCopies = new ICompilationUnit[1]; |
1595 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83012/Test.java", |
1689 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83012/Test.java", |
1596 |
"package b83012;\n" + |
1690 |
"package b83012;\n" + |
Lines 1622-1628
Link Here
|
1622 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83230" |
1716 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83230" |
1623 |
*/ |
1717 |
*/ |
1624 |
private void setUpBug83230_Explicit() throws CoreException { |
1718 |
private void setUpBug83230_Explicit() throws CoreException { |
1625 |
this.resultCollector.showRule = true; |
1719 |
this.resultCollector.showRule(); |
1626 |
this.workingCopies = new ICompilationUnit[1]; |
1720 |
this.workingCopies = new ICompilationUnit[1]; |
1627 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.java", |
1721 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.java", |
1628 |
"package b83230;\n" + |
1722 |
"package b83230;\n" + |
Lines 1661-1667
Link Here
|
1661 |
); |
1755 |
); |
1662 |
} |
1756 |
} |
1663 |
public void testBug83230_Explicit() throws CoreException { |
1757 |
public void testBug83230_Explicit() throws CoreException { |
1664 |
this.resultCollector.showRule = true; |
1758 |
this.resultCollector.showRule(); |
1665 |
setUpBug83230_Explicit(); |
1759 |
setUpBug83230_Explicit(); |
1666 |
IMethod method = selectMethod(this.workingCopies[0], "authorName"); |
1760 |
IMethod method = selectMethod(this.workingCopies[0], "authorName"); |
1667 |
search(method, REFERENCES); |
1761 |
search(method, REFERENCES); |
Lines 1676-1682
Link Here
|
1676 |
); |
1770 |
); |
1677 |
} |
1771 |
} |
1678 |
public void testBug83230_Explicit01() throws CoreException { |
1772 |
public void testBug83230_Explicit01() throws CoreException { |
1679 |
this.resultCollector.showRule = true; |
1773 |
this.resultCollector.showRule(); |
1680 |
setUpBug83230_Explicit(); |
1774 |
setUpBug83230_Explicit(); |
1681 |
IMethod method = selectMethod(this.workingCopies[0], "authorName"); |
1775 |
IMethod method = selectMethod(this.workingCopies[0], "authorName"); |
1682 |
search(method, DECLARATIONS); |
1776 |
search(method, DECLARATIONS); |
Lines 1685-1691
Link Here
|
1685 |
); |
1779 |
); |
1686 |
} |
1780 |
} |
1687 |
public void testBug83230_Explicit02() throws CoreException { |
1781 |
public void testBug83230_Explicit02() throws CoreException { |
1688 |
this.resultCollector.showRule = true; |
1782 |
this.resultCollector.showRule(); |
1689 |
setUpBug83230_Explicit(); |
1783 |
setUpBug83230_Explicit(); |
1690 |
IType type = selectType(this.workingCopies[0], "Address"); |
1784 |
IType type = selectType(this.workingCopies[0], "Address"); |
1691 |
search(type, REFERENCES); |
1785 |
search(type, REFERENCES); |
Lines 1695-1701
Link Here
|
1695 |
); |
1789 |
); |
1696 |
} |
1790 |
} |
1697 |
public void testBug83230_Explicit03() throws CoreException { |
1791 |
public void testBug83230_Explicit03() throws CoreException { |
1698 |
this.resultCollector.showRule = true; |
1792 |
this.resultCollector.showRule(); |
1699 |
setUpBug83230_Explicit(); |
1793 |
setUpBug83230_Explicit(); |
1700 |
IMethod method = selectMethod(this.workingCopies[0], "foo"); |
1794 |
IMethod method = selectMethod(this.workingCopies[0], "foo"); |
1701 |
search(method, REFERENCES); |
1795 |
search(method, REFERENCES); |
Lines 1704-1710
Link Here
|
1704 |
); |
1798 |
); |
1705 |
} |
1799 |
} |
1706 |
public void testBug83230_Explicit04() throws CoreException { |
1800 |
public void testBug83230_Explicit04() throws CoreException { |
1707 |
this.resultCollector.showRule = true; |
1801 |
this.resultCollector.showRule(); |
1708 |
setUpBug83230_Explicit(); |
1802 |
setUpBug83230_Explicit(); |
1709 |
IField field = selectField(this.workingCopies[0], "city"); |
1803 |
IField field = selectField(this.workingCopies[0], "city"); |
1710 |
search(field, REFERENCES); |
1804 |
search(field, REFERENCES); |
Lines 1713-1719
Link Here
|
1713 |
); |
1807 |
); |
1714 |
} |
1808 |
} |
1715 |
public void testBug83230_Explicit05() throws CoreException { |
1809 |
public void testBug83230_Explicit05() throws CoreException { |
1716 |
this.resultCollector.showRule = true; |
1810 |
this.resultCollector.showRule(); |
1717 |
setUpBug83230_Explicit(); |
1811 |
setUpBug83230_Explicit(); |
1718 |
IField field = selectField(this.workingCopies[0], "ageMin"); |
1812 |
IField field = selectField(this.workingCopies[0], "ageMin"); |
1719 |
search(field, REFERENCES); |
1813 |
search(field, REFERENCES); |
Lines 1722-1728
Link Here
|
1722 |
); |
1816 |
); |
1723 |
} |
1817 |
} |
1724 |
public void testBug83230_Implicit01() throws CoreException { |
1818 |
public void testBug83230_Implicit01() throws CoreException { |
1725 |
this.resultCollector.showRule = true; |
1819 |
this.resultCollector.showRule(); |
1726 |
this.workingCopies = new ICompilationUnit[1]; |
1820 |
this.workingCopies = new ICompilationUnit[1]; |
1727 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.java", |
1821 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.java", |
1728 |
"package b83230;\n" + |
1822 |
"package b83230;\n" + |
Lines 1747-1753
Link Here
|
1747 |
); |
1841 |
); |
1748 |
} |
1842 |
} |
1749 |
public void testBug83230_Implicit02() throws CoreException { |
1843 |
public void testBug83230_Implicit02() throws CoreException { |
1750 |
this.resultCollector.showRule = true; |
1844 |
this.resultCollector.showRule(); |
1751 |
this.workingCopies = new ICompilationUnit[1]; |
1845 |
this.workingCopies = new ICompilationUnit[1]; |
1752 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.java", |
1846 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.java", |
1753 |
"package b83230;\n" + |
1847 |
"package b83230;\n" + |
Lines 1778-1784
Link Here
|
1778 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83304" |
1872 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83304" |
1779 |
*/ |
1873 |
*/ |
1780 |
public void testBug83304() throws CoreException { |
1874 |
public void testBug83304() throws CoreException { |
1781 |
this.resultCollector.showRule = true; |
1875 |
this.resultCollector.showRule(); |
1782 |
this.workingCopies = new ICompilationUnit[1]; |
1876 |
this.workingCopies = new ICompilationUnit[1]; |
1783 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Test.java", |
1877 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Test.java", |
1784 |
"package b83304;\n" + |
1878 |
"package b83304;\n" + |
Lines 1800-1806
Link Here
|
1800 |
); |
1894 |
); |
1801 |
} |
1895 |
} |
1802 |
private void setUpBug83304_TypeParameterizedElementPattern() throws CoreException { |
1896 |
private void setUpBug83304_TypeParameterizedElementPattern() throws CoreException { |
1803 |
this.resultCollector.showRule = true; |
1897 |
this.resultCollector.showRule(); |
1804 |
this.workingCopies = new ICompilationUnit[1]; |
1898 |
this.workingCopies = new ICompilationUnit[1]; |
1805 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Types.java", |
1899 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Types.java", |
1806 |
"package b83304;\n" + |
1900 |
"package b83304;\n" + |
Lines 1816-1822
Link Here
|
1816 |
); |
1910 |
); |
1817 |
} |
1911 |
} |
1818 |
public void testBug83304_TypeParameterizedElementPattern() throws CoreException { |
1912 |
public void testBug83304_TypeParameterizedElementPattern() throws CoreException { |
1819 |
this.resultCollector.showRule = true; |
1913 |
this.resultCollector.showRule(); |
1820 |
setUpBug83304_TypeParameterizedElementPattern(); |
1914 |
setUpBug83304_TypeParameterizedElementPattern(); |
1821 |
IType type = selectType(this.workingCopies[0], "Generic", 4); |
1915 |
IType type = selectType(this.workingCopies[0], "Generic", 4); |
1822 |
search(type, REFERENCES, ERASURE_RULE); |
1916 |
search(type, REFERENCES, ERASURE_RULE); |
Lines 1832-1838
Link Here
|
1832 |
); |
1926 |
); |
1833 |
} |
1927 |
} |
1834 |
public void testBug83304_TypeGenericElementPattern() throws CoreException { |
1928 |
public void testBug83304_TypeGenericElementPattern() throws CoreException { |
1835 |
this.resultCollector.showRule = true; |
1929 |
this.resultCollector.showRule(); |
1836 |
setUpBug83304_TypeParameterizedElementPattern(); |
1930 |
setUpBug83304_TypeParameterizedElementPattern(); |
1837 |
IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g1.t.s.def", "Generic.class").getType(); |
1931 |
IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g1.t.s.def", "Generic.class").getType(); |
1838 |
search(type, REFERENCES, ERASURE_RULE); |
1932 |
search(type, REFERENCES, ERASURE_RULE); |
Lines 1848-1854
Link Here
|
1848 |
); |
1942 |
); |
1849 |
} |
1943 |
} |
1850 |
public void testBug83304_TypeStringPattern() throws CoreException { |
1944 |
public void testBug83304_TypeStringPattern() throws CoreException { |
1851 |
this.resultCollector.showRule = true; |
1945 |
this.resultCollector.showRule(); |
1852 |
setUpBug83304_TypeParameterizedElementPattern(); |
1946 |
setUpBug83304_TypeParameterizedElementPattern(); |
1853 |
search("Generic<? super Exception>", TYPE, REFERENCES, ERASURE_RULE); |
1947 |
search("Generic<? super Exception>", TYPE, REFERENCES, ERASURE_RULE); |
1854 |
assertSearchResults( |
1948 |
assertSearchResults( |
Lines 1863-1869
Link Here
|
1863 |
); |
1957 |
); |
1864 |
} |
1958 |
} |
1865 |
private void setUpBug83304_MethodParameterizedElementPattern() throws CoreException { |
1959 |
private void setUpBug83304_MethodParameterizedElementPattern() throws CoreException { |
1866 |
this.resultCollector.showRule = true; |
1960 |
this.resultCollector.showRule(); |
1867 |
this.workingCopies = new ICompilationUnit[1]; |
1961 |
this.workingCopies = new ICompilationUnit[1]; |
1868 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Methods.java", |
1962 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Methods.java", |
1869 |
"package b83304;\n" + |
1963 |
"package b83304;\n" + |
Lines 1880-1886
Link Here
|
1880 |
); |
1974 |
); |
1881 |
} |
1975 |
} |
1882 |
public void testBug83304_MethodParameterizedElementPattern() throws CoreException { |
1976 |
public void testBug83304_MethodParameterizedElementPattern() throws CoreException { |
1883 |
this.resultCollector.showRule = true; |
1977 |
this.resultCollector.showRule(); |
1884 |
setUpBug83304_MethodParameterizedElementPattern(); |
1978 |
setUpBug83304_MethodParameterizedElementPattern(); |
1885 |
IMethod method = selectMethod(this.workingCopies[0], "generic", 2); |
1979 |
IMethod method = selectMethod(this.workingCopies[0], "generic", 2); |
1886 |
search(method, REFERENCES, ERASURE_RULE); |
1980 |
search(method, REFERENCES, ERASURE_RULE); |
Lines 1891-1897
Link Here
|
1891 |
); |
1985 |
); |
1892 |
} |
1986 |
} |
1893 |
public void testBug83304_MethodGenericElementPattern() throws CoreException { |
1987 |
public void testBug83304_MethodGenericElementPattern() throws CoreException { |
1894 |
this.resultCollector.showRule = true; |
1988 |
this.resultCollector.showRule(); |
1895 |
setUpBug83304_MethodParameterizedElementPattern(); |
1989 |
setUpBug83304_MethodParameterizedElementPattern(); |
1896 |
IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g5.m.def", "Single.class").getType(); |
1990 |
IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g5.m.def", "Single.class").getType(); |
1897 |
IMethod method = type.getMethod("generic", new String[] { "TU;" }); |
1991 |
IMethod method = type.getMethod("generic", new String[] { "TU;" }); |
Lines 1903-1909
Link Here
|
1903 |
); |
1997 |
); |
1904 |
} |
1998 |
} |
1905 |
public void testBug83304_MethodStringPattern() throws CoreException { |
1999 |
public void testBug83304_MethodStringPattern() throws CoreException { |
1906 |
this.resultCollector.showRule = true; |
2000 |
this.resultCollector.showRule(); |
1907 |
setUpBug83304_MethodParameterizedElementPattern(); |
2001 |
setUpBug83304_MethodParameterizedElementPattern(); |
1908 |
search("<Exception>generic", METHOD, REFERENCES, ERASURE_RULE); |
2002 |
search("<Exception>generic", METHOD, REFERENCES, ERASURE_RULE); |
1909 |
assertSearchResults( |
2003 |
assertSearchResults( |
Lines 1913-1919
Link Here
|
1913 |
); |
2007 |
); |
1914 |
} |
2008 |
} |
1915 |
private void setUpBug83304_ConstructorGenericElementPattern() throws CoreException { |
2009 |
private void setUpBug83304_ConstructorGenericElementPattern() throws CoreException { |
1916 |
this.resultCollector.showRule = true; |
2010 |
this.resultCollector.showRule(); |
1917 |
this.workingCopies = new ICompilationUnit[1]; |
2011 |
this.workingCopies = new ICompilationUnit[1]; |
1918 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Constructors.java", |
2012 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Constructors.java", |
1919 |
"package b83304;\n" + |
2013 |
"package b83304;\n" + |
Lines 1929-1935
Link Here
|
1929 |
); |
2023 |
); |
1930 |
} |
2024 |
} |
1931 |
public void testBug83304_ConstructorGenericElementPattern() throws CoreException { |
2025 |
public void testBug83304_ConstructorGenericElementPattern() throws CoreException { |
1932 |
this.resultCollector.showRule = true; |
2026 |
this.resultCollector.showRule(); |
1933 |
setUpBug83304_ConstructorGenericElementPattern(); |
2027 |
setUpBug83304_ConstructorGenericElementPattern(); |
1934 |
IMethod method = selectMethod(this.workingCopies[0], "Single", 3); |
2028 |
IMethod method = selectMethod(this.workingCopies[0], "Single", 3); |
1935 |
search(method, REFERENCES, ERASURE_RULE); |
2029 |
search(method, REFERENCES, ERASURE_RULE); |
Lines 1940-1946
Link Here
|
1940 |
); |
2034 |
); |
1941 |
} |
2035 |
} |
1942 |
public void testBug83304_ConstructorParameterizedElementPattern() throws CoreException { |
2036 |
public void testBug83304_ConstructorParameterizedElementPattern() throws CoreException { |
1943 |
this.resultCollector.showRule = true; |
2037 |
this.resultCollector.showRule(); |
1944 |
setUpBug83304_ConstructorGenericElementPattern(); |
2038 |
setUpBug83304_ConstructorGenericElementPattern(); |
1945 |
IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g5.c.def", "Single.class").getType(); |
2039 |
IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g5.c.def", "Single.class").getType(); |
1946 |
IMethod method = type.getMethod("Single", new String[] { "TT;", "TU;" }); |
2040 |
IMethod method = type.getMethod("Single", new String[] { "TT;", "TU;" }); |
Lines 1952-1958
Link Here
|
1952 |
); |
2046 |
); |
1953 |
} |
2047 |
} |
1954 |
public void testBug83304_ConstructorStringPattern() throws CoreException { |
2048 |
public void testBug83304_ConstructorStringPattern() throws CoreException { |
1955 |
this.resultCollector.showRule = true; |
2049 |
this.resultCollector.showRule(); |
1956 |
setUpBug83304_ConstructorGenericElementPattern(); |
2050 |
setUpBug83304_ConstructorGenericElementPattern(); |
1957 |
search("<Exception>Single", CONSTRUCTOR, REFERENCES, ERASURE_RULE); |
2051 |
search("<Exception>Single", CONSTRUCTOR, REFERENCES, ERASURE_RULE); |
1958 |
assertSearchResults( |
2052 |
assertSearchResults( |
Lines 1997-2003
Link Here
|
1997 |
); |
2091 |
); |
1998 |
} |
2092 |
} |
1999 |
public void testBug83804_Type() throws CoreException { |
2093 |
public void testBug83804_Type() throws CoreException { |
2000 |
this.resultCollector.showInsideDoc = true; |
2094 |
this.resultCollector.showInsideDoc(); |
2001 |
setUpBug83804_Type(); |
2095 |
setUpBug83804_Type(); |
2002 |
IType type = this.workingCopies[1].getType("Test"); |
2096 |
IType type = this.workingCopies[1].getType("Test"); |
2003 |
search(type, REFERENCES); |
2097 |
search(type, REFERENCES); |
Lines 2010-2016
Link Here
|
2010 |
); |
2104 |
); |
2011 |
} |
2105 |
} |
2012 |
public void testBug83804_Method() throws CoreException { |
2106 |
public void testBug83804_Method() throws CoreException { |
2013 |
this.resultCollector.showInsideDoc = true; |
2107 |
this.resultCollector.showInsideDoc(); |
2014 |
setUpBug83804_Type(); |
2108 |
setUpBug83804_Type(); |
2015 |
IMethod[] methods = this.workingCopies[1].getType("Test").getMethods(); |
2109 |
IMethod[] methods = this.workingCopies[1].getType("Test").getMethods(); |
2016 |
assertEquals("Invalid number of methods", 1, methods.length); |
2110 |
assertEquals("Invalid number of methods", 1, methods.length); |
Lines 2020-2026
Link Here
|
2020 |
); |
2114 |
); |
2021 |
} |
2115 |
} |
2022 |
public void testBug83804_Field() throws CoreException { |
2116 |
public void testBug83804_Field() throws CoreException { |
2023 |
this.resultCollector.showInsideDoc = true; |
2117 |
this.resultCollector.showInsideDoc(); |
2024 |
setUpBug83804_Type(); |
2118 |
setUpBug83804_Type(); |
2025 |
IField[] fields = this.workingCopies[1].getType("Test").getFields(); |
2119 |
IField[] fields = this.workingCopies[1].getType("Test").getFields(); |
2026 |
assertEquals("Invalid number of fields", 1, fields.length); |
2120 |
assertEquals("Invalid number of fields", 1, fields.length); |
Lines 2035-2041
Link Here
|
2035 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83388" |
2129 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83388" |
2036 |
*/ |
2130 |
*/ |
2037 |
public void testBug83388() throws CoreException { |
2131 |
public void testBug83388() throws CoreException { |
2038 |
this.resultCollector.showRule = true; |
2132 |
this.resultCollector.showRule(); |
2039 |
this.workingCopies = new ICompilationUnit[1]; |
2133 |
this.workingCopies = new ICompilationUnit[1]; |
2040 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83388/R.java", |
2134 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83388/R.java", |
2041 |
"package b83388;\n" + |
2135 |
"package b83388;\n" + |
Lines 2063-2069
Link Here
|
2063 |
); |
2157 |
); |
2064 |
} |
2158 |
} |
2065 |
public void testBug83388b() throws CoreException { |
2159 |
public void testBug83388b() throws CoreException { |
2066 |
this.resultCollector.showRule = true; |
2160 |
this.resultCollector.showRule(); |
2067 |
this.workingCopies = new ICompilationUnit[1]; |
2161 |
this.workingCopies = new ICompilationUnit[1]; |
2068 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83388/R.java", |
2162 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83388/R.java", |
2069 |
"package b83388;\n" + |
2163 |
"package b83388;\n" + |
Lines 2096-2103
Link Here
|
2096 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83693" |
2190 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83693" |
2097 |
*/ |
2191 |
*/ |
2098 |
public void testBug83693() throws CoreException { |
2192 |
public void testBug83693() throws CoreException { |
2099 |
this.resultCollector.showRule = true; |
2193 |
this.resultCollector.showRule(); |
2100 |
this.resultCollector.showInsideDoc = true; |
2194 |
this.resultCollector.showInsideDoc(); |
2101 |
this.workingCopies = new ICompilationUnit[1]; |
2195 |
this.workingCopies = new ICompilationUnit[1]; |
2102 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83693/A.java", |
2196 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83693/A.java", |
2103 |
"package b83693;\n" + |
2197 |
"package b83693;\n" + |
Lines 2153-2159
Link Here
|
2153 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84100" |
2247 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84100" |
2154 |
*/ |
2248 |
*/ |
2155 |
private void setUpBug84100() throws CoreException { |
2249 |
private void setUpBug84100() throws CoreException { |
2156 |
this.resultCollector.showRule = true; |
2250 |
this.resultCollector.showRule(); |
2157 |
this.workingCopies = new ICompilationUnit[2]; |
2251 |
this.workingCopies = new ICompilationUnit[2]; |
2158 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84100/X.java", |
2252 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84100/X.java", |
2159 |
"package b84100;\n" + |
2253 |
"package b84100;\n" + |
Lines 2181-2187
Link Here
|
2181 |
); |
2275 |
); |
2182 |
} |
2276 |
} |
2183 |
public void testBug84100() throws CoreException { |
2277 |
public void testBug84100() throws CoreException { |
2184 |
this.resultCollector.showRule = true; |
2278 |
this.resultCollector.showRule(); |
2185 |
setUpBug84100(); |
2279 |
setUpBug84100(); |
2186 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 1); |
2280 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 1); |
2187 |
search(method, REFERENCES); |
2281 |
search(method, REFERENCES); |
Lines 2190-2196
Link Here
|
2190 |
); |
2284 |
); |
2191 |
} |
2285 |
} |
2192 |
public void testBug84100b() throws CoreException { |
2286 |
public void testBug84100b() throws CoreException { |
2193 |
this.resultCollector.showRule = true; |
2287 |
this.resultCollector.showRule(); |
2194 |
setUpBug84100(); |
2288 |
setUpBug84100(); |
2195 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 2); |
2289 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 2); |
2196 |
search(method, REFERENCES); |
2290 |
search(method, REFERENCES); |
Lines 2199-2205
Link Here
|
2199 |
); |
2293 |
); |
2200 |
} |
2294 |
} |
2201 |
public void testBug84100c() throws CoreException { |
2295 |
public void testBug84100c() throws CoreException { |
2202 |
this.resultCollector.showRule = true; |
2296 |
this.resultCollector.showRule(); |
2203 |
setUpBug84100(); |
2297 |
setUpBug84100(); |
2204 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 3); |
2298 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 3); |
2205 |
search(method, REFERENCES); |
2299 |
search(method, REFERENCES); |
Lines 2209-2215
Link Here
|
2209 |
); |
2303 |
); |
2210 |
} |
2304 |
} |
2211 |
public void testBug84100d() throws CoreException { |
2305 |
public void testBug84100d() throws CoreException { |
2212 |
this.resultCollector.showRule = true; |
2306 |
this.resultCollector.showRule(); |
2213 |
setUpBug84100(); |
2307 |
setUpBug84100(); |
2214 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 4); |
2308 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 4); |
2215 |
search(method, REFERENCES); |
2309 |
search(method, REFERENCES); |
Lines 2218-2224
Link Here
|
2218 |
); |
2312 |
); |
2219 |
} |
2313 |
} |
2220 |
public void testBug84100e() throws CoreException { |
2314 |
public void testBug84100e() throws CoreException { |
2221 |
this.resultCollector.showRule = true; |
2315 |
this.resultCollector.showRule(); |
2222 |
setUpBug84100(); |
2316 |
setUpBug84100(); |
2223 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 5); |
2317 |
IMethod method = selectMethod(this.workingCopies[0], "foo", 5); |
2224 |
search(method, REFERENCES); |
2318 |
search(method, REFERENCES); |
Lines 2232-2238
Link Here
|
2232 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84121" |
2326 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84121" |
2233 |
*/ |
2327 |
*/ |
2234 |
public void testBug84121() throws CoreException { |
2328 |
public void testBug84121() throws CoreException { |
2235 |
this.resultCollector.showRule = true; |
2329 |
this.resultCollector.showRule(); |
2236 |
this.workingCopies = new ICompilationUnit[1]; |
2330 |
this.workingCopies = new ICompilationUnit[1]; |
2237 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84121/Test.java", |
2331 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84121/Test.java", |
2238 |
"package b84121;\n" + |
2332 |
"package b84121;\n" + |
Lines 2257-2263
Link Here
|
2257 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84724" |
2351 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84724" |
2258 |
*/ |
2352 |
*/ |
2259 |
private void setUpBug84724() throws CoreException { |
2353 |
private void setUpBug84724() throws CoreException { |
2260 |
this.resultCollector.showRule = true; |
2354 |
this.resultCollector.showRule(); |
2261 |
this.workingCopies = new ICompilationUnit[2]; |
2355 |
this.workingCopies = new ICompilationUnit[2]; |
2262 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84724/X.java", |
2356 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84724/X.java", |
2263 |
"package b84724;\n" + |
2357 |
"package b84724;\n" + |
Lines 2283-2289
Link Here
|
2283 |
); |
2377 |
); |
2284 |
} |
2378 |
} |
2285 |
public void testBug84724() throws CoreException { |
2379 |
public void testBug84724() throws CoreException { |
2286 |
this.resultCollector.showRule = true; |
2380 |
this.resultCollector.showRule(); |
2287 |
setUpBug84724(); |
2381 |
setUpBug84724(); |
2288 |
IMethod method = selectMethod(this.workingCopies[0], "X", 2); |
2382 |
IMethod method = selectMethod(this.workingCopies[0], "X", 2); |
2289 |
search(method, REFERENCES); |
2383 |
search(method, REFERENCES); |
Lines 2292-2298
Link Here
|
2292 |
); |
2386 |
); |
2293 |
} |
2387 |
} |
2294 |
public void testBug84724b() throws CoreException { |
2388 |
public void testBug84724b() throws CoreException { |
2295 |
this.resultCollector.showRule = true; |
2389 |
this.resultCollector.showRule(); |
2296 |
setUpBug84724(); |
2390 |
setUpBug84724(); |
2297 |
IMethod method = selectMethod(this.workingCopies[0], "X", 3); |
2391 |
IMethod method = selectMethod(this.workingCopies[0], "X", 3); |
2298 |
search(method, REFERENCES); |
2392 |
search(method, REFERENCES); |
Lines 2303-2309
Link Here
|
2303 |
); |
2397 |
); |
2304 |
} |
2398 |
} |
2305 |
public void testBug84724c() throws CoreException { |
2399 |
public void testBug84724c() throws CoreException { |
2306 |
this.resultCollector.showRule = true; |
2400 |
this.resultCollector.showRule(); |
2307 |
setUpBug84724(); |
2401 |
setUpBug84724(); |
2308 |
IMethod method = selectMethod(this.workingCopies[0], "X", 4); |
2402 |
IMethod method = selectMethod(this.workingCopies[0], "X", 4); |
2309 |
search(method, REFERENCES); |
2403 |
search(method, REFERENCES); |
Lines 2312-2318
Link Here
|
2312 |
); |
2406 |
); |
2313 |
} |
2407 |
} |
2314 |
public void testBug84724d() throws CoreException { |
2408 |
public void testBug84724d() throws CoreException { |
2315 |
this.resultCollector.showRule = true; |
2409 |
this.resultCollector.showRule(); |
2316 |
setUpBug84724(); |
2410 |
setUpBug84724(); |
2317 |
IMethod method = selectMethod(this.workingCopies[0], "X", 5); |
2411 |
IMethod method = selectMethod(this.workingCopies[0], "X", 5); |
2318 |
search(method, REFERENCES); |
2412 |
search(method, REFERENCES); |
Lines 2326-2332
Link Here
|
2326 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84727" |
2420 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84727" |
2327 |
*/ |
2421 |
*/ |
2328 |
private void setUpBug84727() throws CoreException { |
2422 |
private void setUpBug84727() throws CoreException { |
2329 |
this.resultCollector.showRule = true; |
2423 |
this.resultCollector.showRule(); |
2330 |
this.workingCopies = new ICompilationUnit[3]; |
2424 |
this.workingCopies = new ICompilationUnit[3]; |
2331 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84727/A.java", |
2425 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84727/A.java", |
2332 |
"package b84727;\n" + |
2426 |
"package b84727;\n" + |
Lines 2353-2359
Link Here
|
2353 |
); |
2447 |
); |
2354 |
} |
2448 |
} |
2355 |
public void testBug84727() throws CoreException { |
2449 |
public void testBug84727() throws CoreException { |
2356 |
this.resultCollector.showRule = true; |
2450 |
this.resultCollector.showRule(); |
2357 |
setUpBug84727(); |
2451 |
setUpBug84727(); |
2358 |
IMethod[] methods = this.workingCopies[0].getType("A").getMethods(); |
2452 |
IMethod[] methods = this.workingCopies[0].getType("A").getMethods(); |
2359 |
assertEquals("Invalid number of methods", 2, methods.length); |
2453 |
assertEquals("Invalid number of methods", 2, methods.length); |
Lines 2363-2369
Link Here
|
2363 |
); |
2457 |
); |
2364 |
} |
2458 |
} |
2365 |
public void testBug84727b() throws CoreException { |
2459 |
public void testBug84727b() throws CoreException { |
2366 |
this.resultCollector.showRule = true; |
2460 |
this.resultCollector.showRule(); |
2367 |
setUpBug84727(); |
2461 |
setUpBug84727(); |
2368 |
IMethod[] methods = this.workingCopies[0].getType("A").getMethods(); |
2462 |
IMethod[] methods = this.workingCopies[0].getType("A").getMethods(); |
2369 |
assertEquals("Invalid number of methods", 2, methods.length); |
2463 |
assertEquals("Invalid number of methods", 2, methods.length); |
Lines 2378-2384
Link Here
|
2378 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=85810" |
2472 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=85810" |
2379 |
*/ |
2473 |
*/ |
2380 |
public void testBug85810() throws CoreException { |
2474 |
public void testBug85810() throws CoreException { |
2381 |
this.resultCollector.showRule = true; |
2475 |
this.resultCollector.showRule(); |
2382 |
this.workingCopies = new ICompilationUnit[1]; |
2476 |
this.workingCopies = new ICompilationUnit[1]; |
2383 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b85810/Test.java", |
2477 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b85810/Test.java", |
2384 |
"package b85810;\n" + |
2478 |
"package b85810;\n" + |
Lines 2400-2406
Link Here
|
2400 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86596" |
2494 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86596" |
2401 |
*/ |
2495 |
*/ |
2402 |
public void testBug86596() throws CoreException { |
2496 |
public void testBug86596() throws CoreException { |
2403 |
this.resultCollector.showRule = true; |
2497 |
this.resultCollector.showRule(); |
2404 |
this.workingCopies = new ICompilationUnit[3]; |
2498 |
this.workingCopies = new ICompilationUnit[3]; |
2405 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86596/aa/link/A.java", |
2499 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86596/aa/link/A.java", |
2406 |
"package b86596.aa.link;\n" + |
2500 |
"package b86596.aa.link;\n" + |
Lines 2431-2437
Link Here
|
2431 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86642" |
2525 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86642" |
2432 |
*/ |
2526 |
*/ |
2433 |
public void testBug86642() throws CoreException { |
2527 |
public void testBug86642() throws CoreException { |
2434 |
this.resultCollector.showRule = true; |
2528 |
this.resultCollector.showRule(); |
2435 |
this.workingCopies = new ICompilationUnit[2]; |
2529 |
this.workingCopies = new ICompilationUnit[2]; |
2436 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86642/A.java", |
2530 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86642/A.java", |
2437 |
"package b86642;\n" + |
2531 |
"package b86642;\n" + |
Lines 2475-2481
Link Here
|
2475 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86380" |
2569 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86380" |
2476 |
*/ |
2570 |
*/ |
2477 |
private void setUpBug86380() throws CoreException { |
2571 |
private void setUpBug86380() throws CoreException { |
2478 |
this.resultCollector.showInsideDoc = true; |
2572 |
this.resultCollector.showInsideDoc(); |
2479 |
this.workingCopies = new ICompilationUnit[2]; |
2573 |
this.workingCopies = new ICompilationUnit[2]; |
2480 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86380/package-info.java", |
2574 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86380/package-info.java", |
2481 |
"/**\n" + |
2575 |
"/**\n" + |
Lines 2493-2499
Link Here
|
2493 |
); |
2587 |
); |
2494 |
} |
2588 |
} |
2495 |
public void testBug86380_Type() throws CoreException { |
2589 |
public void testBug86380_Type() throws CoreException { |
2496 |
this.resultCollector.showInsideDoc = true; |
2590 |
this.resultCollector.showInsideDoc(); |
2497 |
setUpBug86380(); |
2591 |
setUpBug86380(); |
2498 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.java"); |
2592 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.java"); |
2499 |
IType type = unit.getType("Annot"); |
2593 |
IType type = unit.getType("Annot"); |
Lines 2506-2512
Link Here
|
2506 |
); |
2600 |
); |
2507 |
} |
2601 |
} |
2508 |
public void testBug86380_Method() throws CoreException { |
2602 |
public void testBug86380_Method() throws CoreException { |
2509 |
this.resultCollector.showInsideDoc = true; |
2603 |
this.resultCollector.showInsideDoc(); |
2510 |
setUpBug86380(); |
2604 |
setUpBug86380(); |
2511 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.java"); |
2605 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.java"); |
2512 |
IMethod[] methods = unit.getType("Annot").getMethods(); |
2606 |
IMethod[] methods = unit.getType("Annot").getMethods(); |
Lines 2518-2524
Link Here
|
2518 |
); |
2612 |
); |
2519 |
} |
2613 |
} |
2520 |
public void testBug86380_Field() throws CoreException { |
2614 |
public void testBug86380_Field() throws CoreException { |
2521 |
this.resultCollector.showInsideDoc = true; |
2615 |
this.resultCollector.showInsideDoc(); |
2522 |
setUpBug86380(); |
2616 |
setUpBug86380(); |
2523 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.java"); |
2617 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.java"); |
2524 |
IField[] fields = unit.getType("Annot").getFields(); |
2618 |
IField[] fields = unit.getType("Annot").getFields(); |
Lines 2535-2541
Link Here
|
2535 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174" |
2629 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174" |
2536 |
*/ |
2630 |
*/ |
2537 |
public void testBug88174() throws CoreException { |
2631 |
public void testBug88174() throws CoreException { |
2538 |
this.resultCollector.showRule = true; |
2632 |
this.resultCollector.showRule(); |
2539 |
this.workingCopies = new ICompilationUnit[2]; |
2633 |
this.workingCopies = new ICompilationUnit[2]; |
2540 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b88174/Test.java", |
2634 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b88174/Test.java", |
2541 |
"package b88174;\n" + |
2635 |
"package b88174;\n" + |
Lines 3008-3014
Link Here
|
3008 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=92944" |
3102 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=92944" |
3009 |
*/ |
3103 |
*/ |
3010 |
private void setUpBug92944() throws CoreException { |
3104 |
private void setUpBug92944() throws CoreException { |
3011 |
this.resultCollector.showRule = true; |
3105 |
this.resultCollector.showRule(); |
3012 |
this.workingCopies = new ICompilationUnit[1]; |
3106 |
this.workingCopies = new ICompilationUnit[1]; |
3013 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b92944/Test.java", |
3107 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b92944/Test.java", |
3014 |
"package b92944;\n" + |
3108 |
"package b92944;\n" + |
Lines 3019-3025
Link Here
|
3019 |
); |
3113 |
); |
3020 |
} |
3114 |
} |
3021 |
public void testBug92944_TYPE() throws CoreException { |
3115 |
public void testBug92944_TYPE() throws CoreException { |
3022 |
this.resultCollector.showRule = true; |
3116 |
this.resultCollector.showRule(); |
3023 |
setUpBug92944(); |
3117 |
setUpBug92944(); |
3024 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3118 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3025 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
3119 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
Lines 3042-3048
Link Here
|
3042 |
requestor); |
3136 |
requestor); |
3043 |
} |
3137 |
} |
3044 |
public void testBug92944_CLASS() throws CoreException { |
3138 |
public void testBug92944_CLASS() throws CoreException { |
3045 |
this.resultCollector.showRule = true; |
3139 |
this.resultCollector.showRule(); |
3046 |
setUpBug92944(); |
3140 |
setUpBug92944(); |
3047 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3141 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3048 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
3142 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
Lines 3063-3069
Link Here
|
3063 |
requestor); |
3157 |
requestor); |
3064 |
} |
3158 |
} |
3065 |
public void testBug92944_CLASS_AND_INTERFACE() throws CoreException { |
3159 |
public void testBug92944_CLASS_AND_INTERFACE() throws CoreException { |
3066 |
this.resultCollector.showRule = true; |
3160 |
this.resultCollector.showRule(); |
3067 |
setUpBug92944(); |
3161 |
setUpBug92944(); |
3068 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3162 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3069 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
3163 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
Lines 3085-3091
Link Here
|
3085 |
requestor); |
3179 |
requestor); |
3086 |
} |
3180 |
} |
3087 |
public void testBug92944_CLASS_AND_ENUM() throws CoreException { |
3181 |
public void testBug92944_CLASS_AND_ENUM() throws CoreException { |
3088 |
this.resultCollector.showRule = true; |
3182 |
this.resultCollector.showRule(); |
3089 |
setUpBug92944(); |
3183 |
setUpBug92944(); |
3090 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3184 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3091 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
3185 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
Lines 3107-3113
Link Here
|
3107 |
requestor); |
3201 |
requestor); |
3108 |
} |
3202 |
} |
3109 |
public void testBug92944_INTERFACE() throws CoreException { |
3203 |
public void testBug92944_INTERFACE() throws CoreException { |
3110 |
this.resultCollector.showRule = true; |
3204 |
this.resultCollector.showRule(); |
3111 |
setUpBug92944(); |
3205 |
setUpBug92944(); |
3112 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3206 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3113 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
3207 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
Lines 3127-3133
Link Here
|
3127 |
requestor); |
3221 |
requestor); |
3128 |
} |
3222 |
} |
3129 |
public void testBug92944_ENUM() throws CoreException { |
3223 |
public void testBug92944_ENUM() throws CoreException { |
3130 |
this.resultCollector.showRule = true; |
3224 |
this.resultCollector.showRule(); |
3131 |
setUpBug92944(); |
3225 |
setUpBug92944(); |
3132 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3226 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3133 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
3227 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
Lines 3147-3153
Link Here
|
3147 |
requestor); |
3241 |
requestor); |
3148 |
} |
3242 |
} |
3149 |
public void testBug92944_ANNOTATION_TYPE() throws CoreException { |
3243 |
public void testBug92944_ANNOTATION_TYPE() throws CoreException { |
3150 |
this.resultCollector.showRule = true; |
3244 |
this.resultCollector.showRule(); |
3151 |
setUpBug92944(); |
3245 |
setUpBug92944(); |
3152 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3246 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
3153 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
3247 |
new SearchEngine(this.workingCopies).searchAllTypeNames( |
Lines 3177-3183
Link Here
|
3177 |
*/ |
3271 |
*/ |
3178 |
public void testBug93392() throws CoreException { |
3272 |
public void testBug93392() throws CoreException { |
3179 |
TestCollector collector = new TestCollector(); |
3273 |
TestCollector collector = new TestCollector(); |
3180 |
collector.showAccuracy = true; |
3274 |
collector.showAccuracy(true); |
3181 |
this.workingCopies = new ICompilationUnit[1]; |
3275 |
this.workingCopies = new ICompilationUnit[1]; |
3182 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b93392/Test.java", |
3276 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b93392/Test.java", |
3183 |
"package b93392;\n" + |
3277 |
"package b93392;\n" + |
Lines 3503-3509
Link Here
|
3503 |
|
3597 |
|
3504 |
// Verify matches |
3598 |
// Verify matches |
3505 |
TestCollector occurencesCollector = new TestCollector(); |
3599 |
TestCollector occurencesCollector = new TestCollector(); |
3506 |
occurencesCollector.showAccuracy = true; |
3600 |
occurencesCollector.showAccuracy(true); |
3507 |
search(type, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3601 |
search(type, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3508 |
assertSearchResults( |
3602 |
assertSearchResults( |
3509 |
"src/b95794/Test.java [b95794.Test] EXACT_MATCH\n" + |
3603 |
"src/b95794/Test.java [b95794.Test] EXACT_MATCH\n" + |
Lines 3519-3531
Link Here
|
3519 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3613 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3520 |
} |
3614 |
} |
3521 |
public void testBug95794b() throws CoreException { |
3615 |
public void testBug95794b() throws CoreException { |
3522 |
this.resultCollector.showRule = true; |
3616 |
this.resultCollector.showRule(); |
3523 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b95794", "Test.java"); |
3617 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b95794", "Test.java"); |
3524 |
IType type = unit.getType("Test").getType("Color"); |
3618 |
IType type = unit.getType("Test").getType("Color"); |
3525 |
|
3619 |
|
3526 |
// Verify matches |
3620 |
// Verify matches |
3527 |
TestCollector occurencesCollector = new TestCollector(); |
3621 |
TestCollector occurencesCollector = new TestCollector(); |
3528 |
occurencesCollector.showAccuracy = true; |
3622 |
occurencesCollector.showAccuracy(true); |
3529 |
search(type, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3623 |
search(type, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3530 |
assertSearchResults( |
3624 |
assertSearchResults( |
3531 |
"src/b95794/Test.java [b95794.Test.Color] EXACT_MATCH\n" + |
3625 |
"src/b95794/Test.java [b95794.Test.Color] EXACT_MATCH\n" + |
Lines 3541-3553
Link Here
|
3541 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3635 |
assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size()); |
3542 |
} |
3636 |
} |
3543 |
public void testBug95794c() throws CoreException { |
3637 |
public void testBug95794c() throws CoreException { |
3544 |
this.resultCollector.showRule = true; |
3638 |
this.resultCollector.showRule(); |
3545 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b95794", "Test.java"); |
3639 |
ICompilationUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b95794", "Test.java"); |
3546 |
IField field = unit.getType("Test").getType("Color").getField("WHITE"); |
3640 |
IField field = unit.getType("Test").getType("Color").getField("WHITE"); |
3547 |
|
3641 |
|
3548 |
// Verify matches |
3642 |
// Verify matches |
3549 |
TestCollector occurencesCollector = new TestCollector(); |
3643 |
TestCollector occurencesCollector = new TestCollector(); |
3550 |
occurencesCollector.showAccuracy = true; |
3644 |
occurencesCollector.showAccuracy(true); |
3551 |
search(field, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3645 |
search(field, ALL_OCCURRENCES, getJavaSearchScope(), occurencesCollector); |
3552 |
assertSearchResults( |
3646 |
assertSearchResults( |
3553 |
"src/b95794/Test.java [WHITE] EXACT_MATCH\n" + |
3647 |
"src/b95794/Test.java [WHITE] EXACT_MATCH\n" + |
Lines 3656-3662
Link Here
|
3656 |
*/ |
3750 |
*/ |
3657 |
public void testBug97087() throws CoreException { |
3751 |
public void testBug97087() throws CoreException { |
3658 |
this.workingCopies = new ICompilationUnit[1]; |
3752 |
this.workingCopies = new ICompilationUnit[1]; |
3659 |
this.resultCollector.showRule = true; |
3753 |
this.resultCollector.showRule(); |
3660 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97087/Bug.java", |
3754 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97087/Bug.java", |
3661 |
"package b97087;\n" + |
3755 |
"package b97087;\n" + |
3662 |
"public class Bug<Type> {\n" + |
3756 |
"public class Bug<Type> {\n" + |
Lines 3796-3802
Link Here
|
3796 |
this.workingCopies[1].commitWorkingCopy(true, null); |
3890 |
this.workingCopies[1].commitWorkingCopy(true, null); |
3797 |
this.workingCopies[2].commitWorkingCopy(true, null); |
3891 |
this.workingCopies[2].commitWorkingCopy(true, null); |
3798 |
this.workingCopies[3].commitWorkingCopy(true, null); |
3892 |
this.workingCopies[3].commitWorkingCopy(true, null); |
3799 |
this.resultCollector.showRule = true; |
3893 |
this.resultCollector.showRule(); |
3800 |
IType type = this.workingCopies[0].getType("L"); |
3894 |
IType type = this.workingCopies[0].getType("L"); |
3801 |
search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH); |
3895 |
search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH); |
3802 |
assertSearchResults( |
3896 |
assertSearchResults( |
Lines 3849-3855
Link Here
|
3849 |
this.workingCopies[1].commitWorkingCopy(true, null); |
3943 |
this.workingCopies[1].commitWorkingCopy(true, null); |
3850 |
this.workingCopies[2].commitWorkingCopy(true, null); |
3944 |
this.workingCopies[2].commitWorkingCopy(true, null); |
3851 |
this.workingCopies[3].commitWorkingCopy(true, null); |
3945 |
this.workingCopies[3].commitWorkingCopy(true, null); |
3852 |
this.resultCollector.showRule = true; |
3946 |
this.resultCollector.showRule(); |
3853 |
IType type = this.workingCopies[0].getType("L"); |
3947 |
IType type = this.workingCopies[0].getType("L"); |
3854 |
search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH); |
3948 |
search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH); |
3855 |
assertSearchResults( |
3949 |
assertSearchResults( |
Lines 4042-4048
Link Here
|
4042 |
"public @interface Annot {\n" + |
4136 |
"public @interface Annot {\n" + |
4043 |
"}\n" |
4137 |
"}\n" |
4044 |
); |
4138 |
); |
4045 |
this.resultCollector.showInsideDoc = true; |
4139 |
this.resultCollector.showInsideDoc(); |
4046 |
IType type = this.workingCopies[1].getType("Test"); |
4140 |
IType type = this.workingCopies[1].getType("Test"); |
4047 |
search(type, REFERENCES); |
4141 |
search(type, REFERENCES); |
4048 |
assertSearchResults( |
4142 |
assertSearchResults( |
Lines 6036-6042
Link Here
|
6036 |
"}" |
6130 |
"}" |
6037 |
); |
6131 |
); |
6038 |
IType type = this.workingCopies[0].getType("X"); |
6132 |
IType type = this.workingCopies[0].getType("X"); |
6039 |
this.resultCollector.showRule = true; |
6133 |
this.resultCollector.showRule(); |
6040 |
search(type, REFERENCES, ERASURE_RULE); |
6134 |
search(type, REFERENCES, ERASURE_RULE); |
6041 |
assertSearchResults( |
6135 |
assertSearchResults( |
6042 |
"src/p1/X.java p1.X.gen [X] EXACT_MATCH\n" + |
6136 |
"src/p1/X.java p1.X.gen [X] EXACT_MATCH\n" + |
Lines 6485-6491
Link Here
|
6485 |
"}" |
6579 |
"}" |
6486 |
); |
6580 |
); |
6487 |
IType type = this.workingCopies[0].getType("Foo"); |
6581 |
IType type = this.workingCopies[0].getType("Foo"); |
6488 |
this.resultCollector.showRule = true; |
6582 |
this.resultCollector.showRule(); |
6489 |
new SearchEngine(this.workingCopies).search( |
6583 |
new SearchEngine(this.workingCopies).search( |
6490 |
SearchPattern.createPattern(type, REFERENCES), |
6584 |
SearchPattern.createPattern(type, REFERENCES), |
6491 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
6585 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
Lines 7449-7455
Link Here
|
7449 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=148380" |
7543 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=148380" |
7450 |
*/ |
7544 |
*/ |
7451 |
public void testBug148380_SearchAllTypes_wc() throws CoreException { |
7545 |
public void testBug148380_SearchAllTypes_wc() throws CoreException { |
7452 |
this.resultCollector.showRule = true; |
7546 |
this.resultCollector.showRule(); |
7453 |
this.workingCopies = new ICompilationUnit[4]; |
7547 |
this.workingCopies = new ICompilationUnit[4]; |
7454 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b148380/I.java", |
7548 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b148380/I.java", |
7455 |
"package b148380;\n" + |
7549 |
"package b148380;\n" + |
Lines 7556-7562
Link Here
|
7556 |
); |
7650 |
); |
7557 |
waitUntilIndexesReady(); |
7651 |
waitUntilIndexesReady(); |
7558 |
IPackageFragment packageFragment = getPackage("/JavaSearchBugs/src/b153765"); |
7652 |
IPackageFragment packageFragment = getPackage("/JavaSearchBugs/src/b153765"); |
7559 |
this.resultCollector.showSelection = true; |
7653 |
this.resultCollector.showSelection(); |
7560 |
search(packageFragment, REFERENCES); |
7654 |
search(packageFragment, REFERENCES); |
7561 |
assertSearchResults( |
7655 |
assertSearchResults( |
7562 |
"src/b153765/test/SomeClass.java void b153765.test.SomeClass.foo() [ @§|b153765|§.Unimportant public void foo() {}] EXACT_MATCH" |
7656 |
"src/b153765/test/SomeClass.java void b153765.test.SomeClass.foo() [ @§|b153765|§.Unimportant public void foo() {}] EXACT_MATCH" |
Lines 7610-7616
Link Here
|
7610 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156177" |
7704 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156177" |
7611 |
*/ |
7705 |
*/ |
7612 |
public void testBug156177() throws CoreException { |
7706 |
public void testBug156177() throws CoreException { |
7613 |
this.resultCollector.showRule = true; |
7707 |
this.resultCollector.showRule(); |
7614 |
this.workingCopies = new ICompilationUnit[1]; |
7708 |
this.workingCopies = new ICompilationUnit[1]; |
7615 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b156177/Test.java", |
7709 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b156177/Test.java", |
7616 |
"package b156177;\n" + |
7710 |
"package b156177;\n" + |
Lines 7643-7649
Link Here
|
7643 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156491" |
7737 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156491" |
7644 |
*/ |
7738 |
*/ |
7645 |
public void testBug156491() throws CoreException { |
7739 |
public void testBug156491() throws CoreException { |
7646 |
this.resultCollector.showRule = true; |
7740 |
this.resultCollector.showRule(); |
7647 |
this.workingCopies = new ICompilationUnit[1]; |
7741 |
this.workingCopies = new ICompilationUnit[1]; |
7648 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/pack/Test.java", |
7742 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/pack/Test.java", |
7649 |
"package pack;\n" + |
7743 |
"package pack;\n" + |
Lines 7714-7720
Link Here
|
7714 |
); |
7808 |
); |
7715 |
} |
7809 |
} |
7716 |
public void testBug156491a() throws CoreException { |
7810 |
public void testBug156491a() throws CoreException { |
7717 |
this.resultCollector.showRule = true; |
7811 |
this.resultCollector.showRule(); |
7718 |
setUpBug156491(); |
7812 |
setUpBug156491(); |
7719 |
IMethod method = this.workingCopies[0].getType("L2").getMethod("test", new String[0]); |
7813 |
IMethod method = this.workingCopies[0].getType("L2").getMethod("test", new String[0]); |
7720 |
this.resultCollector.showFlavors = PatternLocator.SUPER_INVOCATION_FLAVOR; |
7814 |
this.resultCollector.showFlavors = PatternLocator.SUPER_INVOCATION_FLAVOR; |
Lines 7726-7732
Link Here
|
7726 |
); |
7820 |
); |
7727 |
} |
7821 |
} |
7728 |
public void testBug156491b() throws CoreException { |
7822 |
public void testBug156491b() throws CoreException { |
7729 |
this.resultCollector.showRule = true; |
7823 |
this.resultCollector.showRule(); |
7730 |
setUpBug156491(); |
7824 |
setUpBug156491(); |
7731 |
IMethod method = this.workingCopies[0].getType("L1").getMethod("test", new String[0]); |
7825 |
IMethod method = this.workingCopies[0].getType("L1").getMethod("test", new String[0]); |
7732 |
this.resultCollector.showFlavors = PatternLocator.SUPER_INVOCATION_FLAVOR; |
7826 |
this.resultCollector.showFlavors = PatternLocator.SUPER_INVOCATION_FLAVOR; |
Lines 7744-7750
Link Here
|
7744 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160301" |
7838 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160301" |
7745 |
*/ |
7839 |
*/ |
7746 |
public void testBug160301() throws CoreException { |
7840 |
public void testBug160301() throws CoreException { |
7747 |
this.resultCollector.showRule = true; |
7841 |
this.resultCollector.showRule(); |
7748 |
this.workingCopies = new ICompilationUnit[1]; |
7842 |
this.workingCopies = new ICompilationUnit[1]; |
7749 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
7843 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
7750 |
"public class Test {\n" + |
7844 |
"public class Test {\n" + |
Lines 7774-7780
Link Here
|
7774 |
); |
7868 |
); |
7775 |
} |
7869 |
} |
7776 |
public void testBug160301b() throws CoreException { |
7870 |
public void testBug160301b() throws CoreException { |
7777 |
this.resultCollector.showRule = true; |
7871 |
this.resultCollector.showRule(); |
7778 |
this.workingCopies = new ICompilationUnit[1]; |
7872 |
this.workingCopies = new ICompilationUnit[1]; |
7779 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/test/Test.java", |
7873 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/test/Test.java", |
7780 |
"package test;\n" + |
7874 |
"package test;\n" + |
Lines 7810-7816
Link Here
|
7810 |
); |
7904 |
); |
7811 |
} |
7905 |
} |
7812 |
public void testBug160301_Interface() throws CoreException { |
7906 |
public void testBug160301_Interface() throws CoreException { |
7813 |
this.resultCollector.showRule = true; |
7907 |
this.resultCollector.showRule(); |
7814 |
this.workingCopies = new ICompilationUnit[1]; |
7908 |
this.workingCopies = new ICompilationUnit[1]; |
7815 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
7909 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
7816 |
"public class Test {\n" + |
7910 |
"public class Test {\n" + |
Lines 7864-7870
Link Here
|
7864 |
); |
7958 |
); |
7865 |
} |
7959 |
} |
7866 |
public void testBug160301_Abstract() throws CoreException { |
7960 |
public void testBug160301_Abstract() throws CoreException { |
7867 |
this.resultCollector.showRule = true; |
7961 |
this.resultCollector.showRule(); |
7868 |
this.workingCopies = new ICompilationUnit[1]; |
7962 |
this.workingCopies = new ICompilationUnit[1]; |
7869 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
7963 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
7870 |
"public class Test {\n" + |
7964 |
"public class Test {\n" + |
Lines 7911-7917
Link Here
|
7911 |
); |
8005 |
); |
7912 |
} |
8006 |
} |
7913 |
public void testBug160301_Abstract2() throws CoreException { |
8007 |
public void testBug160301_Abstract2() throws CoreException { |
7914 |
this.resultCollector.showRule = true; |
8008 |
this.resultCollector.showRule(); |
7915 |
this.workingCopies = new ICompilationUnit[1]; |
8009 |
this.workingCopies = new ICompilationUnit[1]; |
7916 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
8010 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
7917 |
"public class Test {\n" + |
8011 |
"public class Test {\n" + |
Lines 7946-7952
Link Here
|
7946 |
); |
8040 |
); |
7947 |
} |
8041 |
} |
7948 |
public void testBug160301_Abstract3() throws CoreException { |
8042 |
public void testBug160301_Abstract3() throws CoreException { |
7949 |
this.resultCollector.showRule = true; |
8043 |
this.resultCollector.showRule(); |
7950 |
this.workingCopies = new ICompilationUnit[1]; |
8044 |
this.workingCopies = new ICompilationUnit[1]; |
7951 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
8045 |
this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.java", |
7952 |
"public class Test {\n" + |
8046 |
"public class Test {\n" + |
Lines 8301-8307
Link Here
|
8301 |
); |
8395 |
); |
8302 |
} |
8396 |
} |
8303 |
public void testBug164121a() throws CoreException { |
8397 |
public void testBug164121a() throws CoreException { |
8304 |
this.resultCollector.showRule = true; |
8398 |
this.resultCollector.showRule(); |
8305 |
setUpBug164121(); |
8399 |
setUpBug164121(); |
8306 |
ILocalVariable param = getLocalVariable(this.workingCopies[0], "param", "param"); |
8400 |
ILocalVariable param = getLocalVariable(this.workingCopies[0], "param", "param"); |
8307 |
search(param, DECLARATIONS); |
8401 |
search(param, DECLARATIONS); |
Lines 8310-8316
Link Here
|
8310 |
); |
8404 |
); |
8311 |
} |
8405 |
} |
8312 |
public void testBug164121b() throws CoreException { |
8406 |
public void testBug164121b() throws CoreException { |
8313 |
this.resultCollector.showRule = true; |
8407 |
this.resultCollector.showRule(); |
8314 |
setUpBug164121(); |
8408 |
setUpBug164121(); |
8315 |
ILocalVariable param = getLocalVariable(this.workingCopies[0], "param", "param"); |
8409 |
ILocalVariable param = getLocalVariable(this.workingCopies[0], "param", "param"); |
8316 |
search(param, ALL_OCCURRENCES); |
8410 |
search(param, ALL_OCCURRENCES); |
Lines 8336-8342
Link Here
|
8336 |
assertTrue("Search match element "+element.getElementName()+" should exist!!!", element.exists()); |
8430 |
assertTrue("Search match element "+element.getElementName()+" should exist!!!", element.exists()); |
8337 |
} |
8431 |
} |
8338 |
}; |
8432 |
}; |
8339 |
collector.showAccuracy = true; |
8433 |
collector.showAccuracy(true); |
8340 |
search(type, REFERENCES, getJavaSearchScope(), collector); |
8434 |
search(type, REFERENCES, getJavaSearchScope(), collector); |
8341 |
assertSearchResults( |
8435 |
assertSearchResults( |
8342 |
"lib/b164791.jar test.<anonymous> EXACT_MATCH\n" + |
8436 |
"lib/b164791.jar test.<anonymous> EXACT_MATCH\n" + |
Lines 8459-8465
Link Here
|
8459 |
} |
8553 |
} |
8460 |
|
8554 |
|
8461 |
}; |
8555 |
}; |
8462 |
testCollector.showAccuracy = true; |
8556 |
testCollector.showAccuracy(true); |
8463 |
IMethod method = this.workingCopies[0].getType("ClassA").getMethod("setValue", new String[] { "I" }); |
8557 |
IMethod method = this.workingCopies[0].getType("ClassA").getMethod("setValue", new String[] { "I" }); |
8464 |
search(method, REFERENCES, getJavaSearchScope(), testCollector); |
8558 |
search(method, REFERENCES, getJavaSearchScope(), testCollector); |
8465 |
assertSearchResults( |
8559 |
assertSearchResults( |
Lines 8675-8681
Link Here
|
8675 |
"}\n" + |
8769 |
"}\n" + |
8676 |
"class Ref {}" |
8770 |
"class Ref {}" |
8677 |
); |
8771 |
); |
8678 |
this.resultCollector.showInsideDoc = true; |
8772 |
this.resultCollector.showInsideDoc(); |
8679 |
new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(this.workingCopies[0], this.resultCollector, null); |
8773 |
new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(this.workingCopies[0], this.resultCollector, null); |
8680 |
assertSearchResults( |
8774 |
assertSearchResults( |
8681 |
"src/b195489/Test.java b195489.Ref [Ref] EXACT_MATCH OUTSIDE_JAVADOC" |
8775 |
"src/b195489/Test.java b195489.Ref [Ref] EXACT_MATCH OUTSIDE_JAVADOC" |
Lines 8696-8702
Link Here
|
8696 |
"}\n" + |
8790 |
"}\n" + |
8697 |
"class Ref {}" |
8791 |
"class Ref {}" |
8698 |
); |
8792 |
); |
8699 |
this.resultCollector.showInsideDoc = true; |
8793 |
this.resultCollector.showInsideDoc(); |
8700 |
new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(this.workingCopies[0], this.resultCollector, null); |
8794 |
new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(this.workingCopies[0], this.resultCollector, null); |
8701 |
assertSearchResults( |
8795 |
assertSearchResults( |
8702 |
"src/b195489/Test.java b195489.Ref [Ref] EXACT_MATCH OUTSIDE_JAVADOC" |
8796 |
"src/b195489/Test.java b195489.Ref [Ref] EXACT_MATCH OUTSIDE_JAVADOC" |
Lines 8713-8719
Link Here
|
8713 |
"}\n" + |
8807 |
"}\n" + |
8714 |
"class Ref {}" |
8808 |
"class Ref {}" |
8715 |
); |
8809 |
); |
8716 |
this.resultCollector.showInsideDoc = true; |
8810 |
this.resultCollector.showInsideDoc(); |
8717 |
new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(this.workingCopies[0], this.resultCollector, null); |
8811 |
new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(this.workingCopies[0], this.resultCollector, null); |
8718 |
assertSearchResults( |
8812 |
assertSearchResults( |
8719 |
"src/b195489/Test.java b195489.Ref [Ref] EXACT_MATCH OUTSIDE_JAVADOC" |
8813 |
"src/b195489/Test.java b195489.Ref [Ref] EXACT_MATCH OUTSIDE_JAVADOC" |
Lines 8731-8737
Link Here
|
8731 |
"}\n" + |
8825 |
"}\n" + |
8732 |
"class Ref {}" |
8826 |
"class Ref {}" |
8733 |
); |
8827 |
); |
8734 |
this.resultCollector.showInsideDoc = true; |
8828 |
this.resultCollector.showInsideDoc(); |
8735 |
String docCommentSupport = JAVA_PROJECT.getOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, true); |
8829 |
String docCommentSupport = JAVA_PROJECT.getOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, true); |
8736 |
JAVA_PROJECT.setOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.DISABLED); |
8830 |
JAVA_PROJECT.setOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.DISABLED); |
8737 |
try { |
8831 |
try { |
Lines 9305-9311
Link Here
|
9305 |
); |
9399 |
); |
9306 |
IType type = this.workingCopies[0].getType("Test"); |
9400 |
IType type = this.workingCopies[0].getType("Test"); |
9307 |
ReferenceCollector collector = new ReferenceCollector(); |
9401 |
ReferenceCollector collector = new ReferenceCollector(); |
9308 |
collector.showSelection = true; |
9402 |
collector.showSelection(); |
9309 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9403 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9310 |
assertSearchResults( |
9404 |
assertSearchResults( |
9311 |
"src/test/Test.java @Annot(clazz=Test.class) [ @Annot(clazz=§|Test|§.class) int x;]", |
9405 |
"src/test/Test.java @Annot(clazz=Test.class) [ @Annot(clazz=§|Test|§.class) int x;]", |
Lines 9321-9327
Link Here
|
9321 |
"}\n" |
9415 |
"}\n" |
9322 |
); |
9416 |
); |
9323 |
ReferenceCollector collector = new ReferenceCollector(); |
9417 |
ReferenceCollector collector = new ReferenceCollector(); |
9324 |
collector.showSelection = true; |
9418 |
collector.showSelection(); |
9325 |
search("Deprecated", TYPE, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9419 |
search("Deprecated", TYPE, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9326 |
assertSearchResults( |
9420 |
assertSearchResults( |
9327 |
"src/test/Test.java @Deprecated() [ @§|Deprecated|§ foo() {}]", |
9421 |
"src/test/Test.java @Deprecated() [ @§|Deprecated|§ foo() {}]", |
Lines 9347-9353
Link Here
|
9347 |
); |
9441 |
); |
9348 |
IType type = this.workingCopies[0].getType("Ref"); |
9442 |
IType type = this.workingCopies[0].getType("Ref"); |
9349 |
ReferenceCollector collector = new ReferenceCollector(); |
9443 |
ReferenceCollector collector = new ReferenceCollector(); |
9350 |
collector.showSelection = true; |
9444 |
collector.showSelection(); |
9351 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9445 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9352 |
assertSearchResults( |
9446 |
assertSearchResults( |
9353 |
"src/comment5/Ref.java void comment5.Ref.doA(Ref).ref [ void doA(§|Ref|§ ref) {}]\n" + |
9447 |
"src/comment5/Ref.java void comment5.Ref.doA(Ref).ref [ void doA(§|Ref|§ ref) {}]\n" + |
Lines 9370-9376
Link Here
|
9370 |
); |
9464 |
); |
9371 |
IField field = this.workingCopies[0].getType("Num").getField("CONST"); |
9465 |
IField field = this.workingCopies[0].getType("Num").getField("CONST"); |
9372 |
ReferenceCollector collector = new ReferenceCollector(); |
9466 |
ReferenceCollector collector = new ReferenceCollector(); |
9373 |
collector.showSelection = true; |
9467 |
collector.showSelection(); |
9374 |
search(field, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9468 |
search(field, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9375 |
assertSearchResults( |
9469 |
assertSearchResults( |
9376 |
"src/comment10/Ref.java @Num(number=Num.CONST) [@Num(number= Num.§|CONST|§)]", |
9470 |
"src/comment10/Ref.java @Num(number=Num.CONST) [@Num(number= Num.§|CONST|§)]", |
Lines 9392-9398
Link Here
|
9392 |
); |
9486 |
); |
9393 |
IType type = this.workingCopies[0].getType("Tag"); |
9487 |
IType type = this.workingCopies[0].getType("Tag"); |
9394 |
TypeReferenceCollector collector = new TypeReferenceCollector(); |
9488 |
TypeReferenceCollector collector = new TypeReferenceCollector(); |
9395 |
collector.showSelection = true; |
9489 |
collector.showSelection(); |
9396 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9490 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9397 |
assertSearchResults( |
9491 |
assertSearchResults( |
9398 |
"src/comment22/Test.java @Tag() [ @§|Tag|§ Test test1, test2, test3;]\n" + |
9492 |
"src/comment22/Test.java @Tag() [ @§|Tag|§ Test test1, test2, test3;]\n" + |
Lines 9414-9420
Link Here
|
9414 |
); |
9508 |
); |
9415 |
IType type = this.workingCopies[0].getType("Test"); |
9509 |
IType type = this.workingCopies[0].getType("Test"); |
9416 |
TypeReferenceCollector collector = new TypeReferenceCollector(); |
9510 |
TypeReferenceCollector collector = new TypeReferenceCollector(); |
9417 |
collector.showSelection = true; |
9511 |
collector.showSelection(); |
9418 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9512 |
search(type, REFERENCES, EXACT_RULE, getJavaSearchScope(), collector); |
9419 |
assertSearchResults( |
9513 |
assertSearchResults( |
9420 |
"src/test/Test.java @Annot(clazz=test.Test.class) [ @Annot(clazz = §|test.Test|§.class) int x, y;]", |
9514 |
"src/test/Test.java @Annot(clazz=test.Test.class) [ @Annot(clazz = §|test.Test|§.class) int x, y;]", |
Lines 9469-9475
Link Here
|
9469 |
"public class Types {\n" + |
9563 |
"public class Types {\n" + |
9470 |
"}\n" |
9564 |
"}\n" |
9471 |
); |
9565 |
); |
9472 |
this.resultCollector.showSelection = true; |
9566 |
this.resultCollector.showSelection(); |
9473 |
search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9567 |
search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9474 |
assertSearchResults( |
9568 |
assertSearchResults( |
9475 |
"src/generics/Generic.java [import §|java.io.Serializable|§;] EXACT_MATCH\n" + |
9569 |
"src/generics/Generic.java [import §|java.io.Serializable|§;] EXACT_MATCH\n" + |
Lines 9508-9514
Link Here
|
9508 |
" Test test;\n" + |
9602 |
" Test test;\n" + |
9509 |
"}\n" |
9603 |
"}\n" |
9510 |
); |
9604 |
); |
9511 |
this.resultCollector.showSelection = true; |
9605 |
this.resultCollector.showSelection(); |
9512 |
search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9606 |
search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9513 |
assertSearchResults( |
9607 |
assertSearchResults( |
9514 |
"src/test/Ref.java [import §|pack.Test|§;] EXACT_MATCH\n" + |
9608 |
"src/test/Ref.java [import §|pack.Test|§;] EXACT_MATCH\n" + |
Lines 9525-9531
Link Here
|
9525 |
addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b211366.jar", false); |
9619 |
addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b211366.jar", false); |
9526 |
try { |
9620 |
try { |
9527 |
IType type = getClassFile("JavaSearchBugs", "lib/b211366.jar", "test", "Bug.class").getType(); |
9621 |
IType type = getClassFile("JavaSearchBugs", "lib/b211366.jar", "test", "Bug.class").getType(); |
9528 |
this.resultCollector.showMatchKind = true; |
9622 |
this.resultCollector.showMatchKind(); |
9529 |
search(type, REFERENCES); |
9623 |
search(type, REFERENCES); |
9530 |
assertSearchResults( |
9624 |
assertSearchResults( |
9531 |
"TypeReferenceMatch: lib/b211366.jar pack.Test [No source] EXACT_MATCH\n" + |
9625 |
"TypeReferenceMatch: lib/b211366.jar pack.Test [No source] EXACT_MATCH\n" + |
Lines 9545-9551
Link Here
|
9545 |
SearchPattern rightPattern = SearchPattern.createPattern(type, REFERENCES); |
9639 |
SearchPattern rightPattern = SearchPattern.createPattern(type, REFERENCES); |
9546 |
SearchPattern leftPattern = SearchPattern.createPattern(type, DECLARATIONS); |
9640 |
SearchPattern leftPattern = SearchPattern.createPattern(type, DECLARATIONS); |
9547 |
SearchPattern pattern = SearchPattern.createOrPattern(leftPattern, rightPattern); |
9641 |
SearchPattern pattern = SearchPattern.createOrPattern(leftPattern, rightPattern); |
9548 |
this.resultCollector.showMatchKind = true; |
9642 |
this.resultCollector.showMatchKind(); |
9549 |
new SearchEngine(this.workingCopies).search( |
9643 |
new SearchEngine(this.workingCopies).search( |
9550 |
pattern, |
9644 |
pattern, |
9551 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
9645 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
Lines 9579-9585
Link Here
|
9579 |
SearchPattern.createPattern("Bug", TYPE, REFERENCES, SearchPattern.R_EXACT_MATCH))); |
9673 |
SearchPattern.createPattern("Bug", TYPE, REFERENCES, SearchPattern.R_EXACT_MATCH))); |
9580 |
IPackageFragmentRoot root = JAVA_PROJECT.getPackageFragmentRoot("/JavaSearchBugs/lib/b211366.jar"); |
9674 |
IPackageFragmentRoot root = JAVA_PROJECT.getPackageFragmentRoot("/JavaSearchBugs/lib/b211366.jar"); |
9581 |
this.resultCollector.sorted = true; |
9675 |
this.resultCollector.sorted = true; |
9582 |
this.resultCollector.showMatchKind = true; |
9676 |
this.resultCollector.showMatchKind(); |
9583 |
new SearchEngine(this.workingCopies).search( |
9677 |
new SearchEngine(this.workingCopies).search( |
9584 |
SearchPattern.createOrPattern(leftPattern, rightPattern), |
9678 |
SearchPattern.createOrPattern(leftPattern, rightPattern), |
9585 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
9679 |
new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, |
Lines 9731-9737
Link Here
|
9731 |
"\n" + |
9825 |
"\n" + |
9732 |
"}\n" |
9826 |
"}\n" |
9733 |
); |
9827 |
); |
9734 |
this.resultCollector.showSelection = true; |
9828 |
this.resultCollector.showSelection(); |
9735 |
ILocalVariable variable = selectLocalVariable(this.workingCopies[0], "test"); |
9829 |
ILocalVariable variable = selectLocalVariable(this.workingCopies[0], "test"); |
9736 |
search(variable, READ_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9830 |
search(variable, READ_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9737 |
assertSearchResults( |
9831 |
assertSearchResults( |
Lines 9751-9757
Link Here
|
9751 |
" int fField;" + |
9845 |
" int fField;" + |
9752 |
"}" |
9846 |
"}" |
9753 |
); |
9847 |
); |
9754 |
this.resultCollector.showSelection = true; |
9848 |
this.resultCollector.showSelection(); |
9755 |
IField field = this.workingCopies[0].getType("Test").getField("fWrapped"); |
9849 |
IField field = this.workingCopies[0].getType("Test").getField("fWrapped"); |
9756 |
search(field, READ_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9850 |
search(field, READ_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9757 |
assertSearchResults( |
9851 |
assertSearchResults( |
Lines 9777-9783
Link Here
|
9777 |
" }\n" + |
9871 |
" }\n" + |
9778 |
"}\n" |
9872 |
"}\n" |
9779 |
); |
9873 |
); |
9780 |
this.resultCollector.showSelection = true; |
9874 |
this.resultCollector.showSelection(); |
9781 |
ILocalVariable variable = selectLocalVariable(this.workingCopies[1], "t1"); |
9875 |
ILocalVariable variable = selectLocalVariable(this.workingCopies[1], "t1"); |
9782 |
search(variable, READ_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9876 |
search(variable, READ_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9783 |
assertSearchResults( |
9877 |
assertSearchResults( |
Lines 9806-9812
Link Here
|
9806 |
" }\n" + |
9900 |
" }\n" + |
9807 |
"}\n" |
9901 |
"}\n" |
9808 |
); |
9902 |
); |
9809 |
this.resultCollector.showSelection = true; |
9903 |
this.resultCollector.showSelection(); |
9810 |
IField field = this.workingCopies[1].getType("X").getField("t1"); |
9904 |
IField field = this.workingCopies[1].getType("X").getField("t1"); |
9811 |
search(field, READ_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9905 |
search(field, READ_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9812 |
assertSearchResults( |
9906 |
assertSearchResults( |
Lines 9834-9840
Link Here
|
9834 |
" }\n" + |
9928 |
" }\n" + |
9835 |
"}\n" |
9929 |
"}\n" |
9836 |
); |
9930 |
); |
9837 |
this.resultCollector.showSelection = true; |
9931 |
this.resultCollector.showSelection(); |
9838 |
ILocalVariable variable = selectLocalVariable(this.workingCopies[1], "t1"); |
9932 |
ILocalVariable variable = selectLocalVariable(this.workingCopies[1], "t1"); |
9839 |
search(variable, WRITE_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9933 |
search(variable, WRITE_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9840 |
assertSearchResults( |
9934 |
assertSearchResults( |
Lines 9861-9867
Link Here
|
9861 |
" }\n" + |
9955 |
" }\n" + |
9862 |
"}\n" |
9956 |
"}\n" |
9863 |
); |
9957 |
); |
9864 |
this.resultCollector.showSelection = true; |
9958 |
this.resultCollector.showSelection(); |
9865 |
IField field = this.workingCopies[1].getType("X").getField("t1"); |
9959 |
IField field = this.workingCopies[1].getType("X").getField("t1"); |
9866 |
search(field, WRITE_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9960 |
search(field, WRITE_ACCESSES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9867 |
assertSearchResults( |
9961 |
assertSearchResults( |
Lines 9887-9895
Link Here
|
9887 |
" }\n" + |
9981 |
" }\n" + |
9888 |
"}\n" |
9982 |
"}\n" |
9889 |
); |
9983 |
); |
9890 |
this.resultCollector.showSelection = true; |
9984 |
this.resultCollector.showSelection(); |
9891 |
this.resultCollector.showAccess = true; |
9985 |
this.resultCollector.showAccess(); |
9892 |
this.resultCollector.showAccuracy = false; |
9986 |
this.resultCollector.showAccuracy(false); |
9893 |
ILocalVariable variable = selectLocalVariable(this.workingCopies[1], "t1"); |
9987 |
ILocalVariable variable = selectLocalVariable(this.workingCopies[1], "t1"); |
9894 |
search(variable, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9988 |
search(variable, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9895 |
assertSearchResults( |
9989 |
assertSearchResults( |
Lines 9919-9927
Link Here
|
9919 |
" }\n" + |
10013 |
" }\n" + |
9920 |
"}\n" |
10014 |
"}\n" |
9921 |
); |
10015 |
); |
9922 |
this.resultCollector.showSelection = true; |
10016 |
this.resultCollector.showSelection(); |
9923 |
this.resultCollector.showAccess = true; |
10017 |
this.resultCollector.showAccess(); |
9924 |
this.resultCollector.showAccuracy = false; |
10018 |
this.resultCollector.showAccuracy(false); |
9925 |
IField field = this.workingCopies[1].getType("X").getField("t1"); |
10019 |
IField field = this.workingCopies[1].getType("X").getField("t1"); |
9926 |
search(field, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
10020 |
search(field, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9927 |
assertSearchResults( |
10021 |
assertSearchResults( |
Lines 9949-9955
Link Here
|
9949 |
" }\n" + |
10043 |
" }\n" + |
9950 |
"}" |
10044 |
"}" |
9951 |
); |
10045 |
); |
9952 |
this.resultCollector.showSelection = true; |
10046 |
this.resultCollector.showSelection(); |
9953 |
IType type = selectType(this.workingCopies[0], "Row"); |
10047 |
IType type = selectType(this.workingCopies[0], "Row"); |
9954 |
search(type, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
10048 |
search(type, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
9955 |
assertSearchResults( |
10049 |
assertSearchResults( |
Lines 9975-9982
Link Here
|
9975 |
" }\n" + |
10069 |
" }\n" + |
9976 |
"}\n" |
10070 |
"}\n" |
9977 |
); |
10071 |
); |
9978 |
this.resultCollector.showSelection = true; |
10072 |
this.resultCollector.showSelection(); |
9979 |
this.resultCollector.showRule = true; |
10073 |
this.resultCollector.showRule(); |
9980 |
SearchPattern typePattern = SearchPattern.createPattern("test", TYPE, ALL_OCCURRENCES, SearchPattern.R_EXACT_MATCH); |
10074 |
SearchPattern typePattern = SearchPattern.createPattern("test", TYPE, ALL_OCCURRENCES, SearchPattern.R_EXACT_MATCH); |
9981 |
SearchPattern methPattern = SearchPattern.createPattern("test", METHOD, ALL_OCCURRENCES, SearchPattern.R_EXACT_MATCH); |
10075 |
SearchPattern methPattern = SearchPattern.createPattern("test", METHOD, ALL_OCCURRENCES, SearchPattern.R_EXACT_MATCH); |
9982 |
SearchPattern fieldPattern = SearchPattern.createPattern("test", FIELD, ALL_OCCURRENCES, SearchPattern.R_EXACT_MATCH); |
10076 |
SearchPattern fieldPattern = SearchPattern.createPattern("test", FIELD, ALL_OCCURRENCES, SearchPattern.R_EXACT_MATCH); |
Lines 10014-10021
Link Here
|
10014 |
"public class Y<T extends X<?>> {\n" + |
10108 |
"public class Y<T extends X<?>> {\n" + |
10015 |
"}\n" |
10109 |
"}\n" |
10016 |
); |
10110 |
); |
10017 |
this.resultCollector.showSelection = true; |
10111 |
this.resultCollector.showSelection(); |
10018 |
this.resultCollector.showRule = true; |
10112 |
this.resultCollector.showRule(); |
10019 |
IType type = this.workingCopies[0].getType("X"); |
10113 |
IType type = this.workingCopies[0].getType("X"); |
10020 |
search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
10114 |
search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
10021 |
assertSearchResults( |
10115 |
assertSearchResults( |
Lines 10036-10043
Link Here
|
10036 |
"public class Z<T extends X<?> & I<?>> {\n" + |
10130 |
"public class Z<T extends X<?> & I<?>> {\n" + |
10037 |
"}\n" |
10131 |
"}\n" |
10038 |
); |
10132 |
); |
10039 |
this.resultCollector.showSelection = true; |
10133 |
this.resultCollector.showSelection(); |
10040 |
this.resultCollector.showRule = true; |
10134 |
this.resultCollector.showRule(); |
10041 |
IType type = this.workingCopies[0].getType("I"); |
10135 |
IType type = this.workingCopies[0].getType("I"); |
10042 |
search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
10136 |
search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH, getJavaSearchWorkingCopiesScope(), this.resultCollector); |
10043 |
assertSearchResults( |
10137 |
assertSearchResults( |
Lines 10107-10113
Link Here
|
10107 |
"\n" + |
10201 |
"\n" + |
10108 |
"}\n" |
10202 |
"}\n" |
10109 |
); |
10203 |
); |
10110 |
this.resultCollector.showSelection = true; |
10204 |
this.resultCollector.showSelection(); |
10111 |
IType type = this.workingCopies[0].getType("Test"); |
10205 |
IType type = this.workingCopies[0].getType("Test"); |
10112 |
search(type, REFERENCES, getJavaSearchWorkingCopiesScope()); |
10206 |
search(type, REFERENCES, getJavaSearchWorkingCopiesScope()); |
10113 |
|
10207 |
|