Lines 13-18
Link Here
|
13 |
import java.io.File; |
13 |
import java.io.File; |
14 |
import java.io.IOException; |
14 |
import java.io.IOException; |
15 |
import java.util.ArrayList; |
15 |
import java.util.ArrayList; |
|
|
16 |
import java.util.HashMap; |
16 |
import java.util.List; |
17 |
import java.util.List; |
17 |
|
18 |
|
18 |
import junit.framework.Test; |
19 |
import junit.framework.Test; |
Lines 26-31
Link Here
|
26 |
import org.eclipse.jdt.core.*; |
27 |
import org.eclipse.jdt.core.*; |
27 |
import org.eclipse.jdt.core.compiler.CharOperation; |
28 |
import org.eclipse.jdt.core.compiler.CharOperation; |
28 |
import org.eclipse.jdt.core.search.*; |
29 |
import org.eclipse.jdt.core.search.*; |
|
|
30 |
import org.eclipse.jdt.core.tests.util.Util; |
29 |
|
31 |
|
30 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
32 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
31 |
import org.eclipse.jdt.internal.core.ClassFile; |
33 |
import org.eclipse.jdt.internal.core.ClassFile; |
Lines 10226-10229
Link Here
|
10226 |
deleteProject("P"); |
10228 |
deleteProject("P"); |
10227 |
} |
10229 |
} |
10228 |
} |
10230 |
} |
|
|
10231 |
|
10232 |
/** |
10233 |
* @bug 250083: Search indexes are not correctly updated |
10234 |
* @test Ensure that a library that is no longer referenced, modified, and referenced again is re-indexed |
10235 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083" |
10236 |
*/ |
10237 |
public void testBug250083() throws Exception { |
10238 |
String libPath = getExternalResourcePath("lib250083.jar"); |
10239 |
try { |
10240 |
Util.createJar( |
10241 |
new String[] { |
10242 |
"p250083/Y250083.java", |
10243 |
"package p250083;\n" + |
10244 |
"public class Y250083 {}" |
10245 |
}, |
10246 |
new HashMap(), |
10247 |
libPath); |
10248 |
createJavaProject("P", new String[0], new String[] {libPath}, ""); |
10249 |
waitUntilIndexesReady(); |
10250 |
deleteExternalFile(libPath); |
10251 |
deleteProject("P"); |
10252 |
|
10253 |
Util.createJar( |
10254 |
new String[] { |
10255 |
"p250083/X250083.java", |
10256 |
"package p250083;\n" + |
10257 |
"public class X250083 {}" |
10258 |
}, |
10259 |
new HashMap(), |
10260 |
libPath); |
10261 |
createJavaProject("P", new String[0], new String[] {libPath}, ""); |
10262 |
TypeNameMatchCollector collector = new TypeNameMatchCollector(); |
10263 |
new SearchEngine().searchAllTypeNames( |
10264 |
null, |
10265 |
new char[][] {"X250083".toCharArray()}, |
10266 |
SearchEngine.createWorkspaceScope(), |
10267 |
collector, |
10268 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
10269 |
null); |
10270 |
assertSearchResults( |
10271 |
"X250083 (not open) [in X250083.class [in p250083 [in "+ getExternalPath() + "lib250083.jar]]]", |
10272 |
collector); |
10273 |
} finally { |
10274 |
deleteExternalFile(libPath); |
10275 |
deleteProject("P"); |
10276 |
} |
10277 |
} |
10278 |
|
10229 |
} |
10279 |
} |