mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
javac ast indices: fix incremental hierarchy update
This commit is contained in:
+1
-1
@@ -263,7 +263,7 @@ public class BackwardReferenceIndexWriter {
|
||||
if (oldSuperClasses != null && !oldSuperClasses.isEmpty()) {
|
||||
myIndex.getHierarchyMap().removeAll(classId, oldSuperClasses);
|
||||
for (LightRef anOldClass : oldSuperClasses) {
|
||||
myIndex.getBackwardHierarchyMap().put(anOldClass, classId);
|
||||
myIndex.getBackwardHierarchyMap().removeFrom(anOldClass, classId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
Backward Hierarchy:
|
||||
Foo -> FooImpl
|
||||
java.lang.Object -> Bar FooImpl
|
||||
|
||||
Backward References:
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.Collections;
|
||||
|
||||
abstract class Foo {
|
||||
|
||||
void m() {
|
||||
Collections.emptySet();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
abstract class Foo implements List {
|
||||
|
||||
void m() {
|
||||
Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.Collections;
|
||||
|
||||
abstract class Foo {
|
||||
|
||||
void m() {
|
||||
Collections.emptySet();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
Backward Hierarchy:
|
||||
java.lang.Object -> Foo
|
||||
|
||||
Backward References:
|
||||
Foo in Foo
|
||||
Foo.<init>(0) in Foo
|
||||
Foo.m(0) in Foo
|
||||
java.lang.Object.<init>(0) in Foo
|
||||
java.util.Collections in Foo
|
||||
java.util.Collections.emptySet(0) in Foo
|
||||
|
||||
Class Definitions:
|
||||
Foo in Foo
|
||||
@@ -0,0 +1,13 @@
|
||||
Backward Hierarchy:
|
||||
java.lang.Object -> Foo
|
||||
|
||||
Backward References:
|
||||
Foo in Bar
|
||||
Foo.<init>(0) in Bar
|
||||
Foo.m(0) in Bar
|
||||
java.lang.Object.<init>(0) in Bar
|
||||
java.util.Collections in Bar
|
||||
java.util.Collections.emptySet(0) in Bar
|
||||
|
||||
Class Definitions:
|
||||
Foo in Bar
|
||||
@@ -0,0 +1,15 @@
|
||||
Backward Hierarchy:
|
||||
java.lang.Object -> Foo
|
||||
java.util.List -> Foo
|
||||
|
||||
Backward References:
|
||||
Foo in Foo
|
||||
Foo.<init>(0) in Foo
|
||||
Foo.m(0) in Foo
|
||||
java.lang.Object.<init>(0) in Foo
|
||||
java.util.Collections in Foo
|
||||
java.util.Collections.emptyList(0) in Foo
|
||||
java.util.List in Foo
|
||||
|
||||
Class Definitions:
|
||||
Foo in Foo
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.Collections;
|
||||
|
||||
class Bar {
|
||||
|
||||
void m() {
|
||||
Collections.emptySet();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import java.util.Collections;
|
||||
|
||||
class Foo {
|
||||
|
||||
void m() {
|
||||
Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Bar {
|
||||
|
||||
void m() {
|
||||
Collections.emptySet();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.Collections;
|
||||
|
||||
class Foo {
|
||||
|
||||
void m() {
|
||||
Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
Backward Hierarchy:
|
||||
java.lang.Object -> Bar Foo
|
||||
|
||||
Backward References:
|
||||
Bar in Bar
|
||||
Bar.<init>(0) in Bar
|
||||
Bar.m(0) in Bar
|
||||
Foo in Foo
|
||||
Foo.<init>(0) in Foo
|
||||
Foo.m(0) in Foo
|
||||
java.lang.Object.<init>(0) in Bar Foo
|
||||
java.util.Collections in Bar Foo
|
||||
java.util.Collections.emptyList(0) in Foo
|
||||
java.util.Collections.emptySet(0) in Bar
|
||||
|
||||
Class Definitions:
|
||||
Bar in Bar
|
||||
Foo in Foo
|
||||
@@ -0,0 +1,18 @@
|
||||
Backward Hierarchy:
|
||||
java.lang.Object -> Bar Foo
|
||||
|
||||
Backward References:
|
||||
Bar in Foo
|
||||
Bar.<init>(0) in Foo
|
||||
Bar.m(0) in Foo
|
||||
Foo in Foo
|
||||
Foo.<init>(0) in Foo
|
||||
Foo.m(0) in Foo
|
||||
java.lang.Object.<init>(0) in Foo
|
||||
java.util.Collections in Foo
|
||||
java.util.Collections.emptyList(0) in Foo
|
||||
java.util.Collections.emptySet(0) in Foo
|
||||
|
||||
Class Definitions:
|
||||
Bar in Foo
|
||||
Foo in Foo
|
||||
@@ -33,6 +33,25 @@ class ReferenceIndexTest : ReferenceIndexTestBase() {
|
||||
assertIndexEquals("afterSecondMakeIndex.txt")
|
||||
}
|
||||
|
||||
fun testIncrementalIndexUpdate2() {
|
||||
assertIndexOnRebuild("Foo.java")
|
||||
changeFileContent("Foo.java", "Foo_2.java")
|
||||
buildAllModules()
|
||||
assertIndexEquals("after1MakeIndex.txt")
|
||||
deleteFile("m/Foo.java")
|
||||
addFile("Bar.java")
|
||||
buildAllModules()
|
||||
assertIndexEquals("after2MakeIndex.txt")
|
||||
}
|
||||
|
||||
fun testIncrementalIndexUpdate3() {
|
||||
assertIndexOnRebuild("Foo.java")
|
||||
changeFileContent("Foo.java", "Foo_2.java")
|
||||
addFile("Bar.java")
|
||||
buildAllModules()
|
||||
assertIndexEquals("after1MakeIndex.txt")
|
||||
}
|
||||
|
||||
fun testFileCaseOnlyRename() {
|
||||
assertIndexOnRebuild("Bar.java")
|
||||
renameFile("Bar.java", "bar.java")
|
||||
|
||||
Reference in New Issue
Block a user