Skip to content

Commit bb19a36

Browse files
convert new index interfaces to abstract classes to reduce breakage
1 parent 86ad25b commit bb19a36

File tree

9 files changed

+46
-46
lines changed

9 files changed

+46
-46
lines changed

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/BridgeMethodIndex.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@
55

66
import java.util.Map;
77

8-
public interface BridgeMethodIndex extends JarIndexer {
9-
void findBridgeMethods();
8+
public abstract class BridgeMethodIndex implements JarIndexer {
9+
public abstract void findBridgeMethods();
1010

11-
boolean isBridgeMethod(MethodEntry entry);
11+
public abstract boolean isBridgeMethod(MethodEntry entry);
1212

13-
boolean isSpecializedMethod(MethodEntry entry);
13+
public abstract boolean isSpecializedMethod(MethodEntry entry);
1414

1515
@Nullable
16-
MethodEntry getBridgeFromSpecialized(MethodEntry specialized);
16+
public abstract MethodEntry getBridgeFromSpecialized(MethodEntry specialized);
1717

18-
MethodEntry getSpecializedFromBridge(MethodEntry bridge);
18+
public abstract MethodEntry getSpecializedFromBridge(MethodEntry bridge);
1919

2020
/**
2121
* Includes "renamed specialized -> bridge" entries.
2222
*/
23-
Map<MethodEntry, MethodEntry> getSpecializedToBridge();
23+
public abstract Map<MethodEntry, MethodEntry> getSpecializedToBridge();
2424

2525
/**
2626
* Only "bridge -> original name" entries.
2727
*/
28-
Map<MethodEntry, MethodEntry> getBridgeToSpecialized();
28+
public abstract Map<MethodEntry, MethodEntry> getBridgeToSpecialized();
2929

3030
@Override
31-
default String getTranslationKey() {
31+
public String getTranslationKey() {
3232
return "progress.jar.indexing.process.bridge_methods";
3333
}
3434
}

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/CombinedBridgeMethodIndex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import java.util.Map;
88

9-
class CombinedBridgeMethodIndex implements BridgeMethodIndex {
9+
class CombinedBridgeMethodIndex extends BridgeMethodIndex {
1010
private final BridgeMethodIndex mainIndex;
1111
private final BridgeMethodIndex libIndex;
1212
private final Map<MethodEntry, MethodEntry> specializedToBridge;

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/CombinedEntryIndex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import java.util.Collection;
1919

20-
class CombinedEntryIndex implements EntryIndex {
20+
class CombinedEntryIndex extends EntryIndex {
2121
private final EntryIndex mainIndex;
2222
private final EntryIndex libIndex;
2323

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/CombinedReferenceIndex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* <b>Note:</b> does <em>not</em> currently index main jar references to library types and members.
1515
*/
16-
class CombinedReferenceIndex implements ReferenceIndex {
16+
class CombinedReferenceIndex extends ReferenceIndex {
1717
private final ReferenceIndex mainIndex;
1818
private final ReferenceIndex libIndex;
1919

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/EntryIndex.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
import java.util.Collection;
1919

20-
public interface EntryIndex extends JarIndexer {
21-
boolean hasClass(ClassEntry entry);
20+
public abstract class EntryIndex implements JarIndexer {
21+
public abstract boolean hasClass(ClassEntry entry);
2222

23-
boolean hasMethod(MethodEntry entry);
23+
public abstract boolean hasMethod(MethodEntry entry);
2424

25-
boolean hasParameter(LocalVariableEntry entry);
25+
public abstract boolean hasParameter(LocalVariableEntry entry);
2626

27-
boolean hasField(FieldEntry entry);
27+
public abstract boolean hasField(FieldEntry entry);
2828

2929
/**
3030
* Checks whether the entry has been indexed and therefore exists in the JAR file.
@@ -35,7 +35,7 @@ public interface EntryIndex extends JarIndexer {
3535
* @param entry the entry to check
3636
* @return whether the entry exists
3737
*/
38-
boolean hasEntry(Entry<?> entry);
38+
public abstract boolean hasEntry(Entry<?> entry);
3939

4040
/**
4141
* Validates that the parameter index is not below the minimum index for its parent method and therefore could be valid.
@@ -45,53 +45,53 @@ public interface EntryIndex extends JarIndexer {
4545
* @return whether the index could be valid
4646
* @see EnigmaProject#validateParameterIndex(LocalVariableEntry)
4747
*/
48-
boolean validateParameterIndex(LocalVariableEntry parameter);
48+
public abstract boolean validateParameterIndex(LocalVariableEntry parameter);
4949

5050
@Nullable
51-
AccessFlags getMethodAccess(MethodEntry entry);
51+
public abstract AccessFlags getMethodAccess(MethodEntry entry);
5252

5353
@Nullable
54-
AccessFlags getParameterAccess(LocalVariableEntry entry);
54+
public abstract AccessFlags getParameterAccess(LocalVariableEntry entry);
5555

5656
@Nullable
57-
AccessFlags getFieldAccess(FieldEntry entry);
57+
public abstract AccessFlags getFieldAccess(FieldEntry entry);
5858

5959
@Nullable
60-
AccessFlags getClassAccess(ClassEntry entry);
60+
public abstract AccessFlags getClassAccess(ClassEntry entry);
6161

6262
@Nullable
63-
AccessFlags getEntryAccess(Entry<?> entry);
63+
public abstract AccessFlags getEntryAccess(Entry<?> entry);
6464

6565
@Nullable
66-
ClassDefEntry getDefinition(ClassEntry entry);
66+
public abstract ClassDefEntry getDefinition(ClassEntry entry);
6767

6868
@Nullable
69-
MethodDefEntry getDefinition(MethodEntry entry);
69+
public abstract MethodDefEntry getDefinition(MethodEntry entry);
7070

7171
@Nullable
72-
LocalVariableDefEntry getDefinition(LocalVariableEntry entry);
72+
public abstract LocalVariableDefEntry getDefinition(LocalVariableEntry entry);
7373

7474
@Nullable
75-
FieldDefEntry getDefinition(FieldEntry entry);
75+
public abstract FieldDefEntry getDefinition(FieldEntry entry);
7676

77-
Collection<ClassEntry> getClasses();
77+
public abstract Collection<ClassEntry> getClasses();
7878

79-
Collection<MethodEntry> getMethods();
79+
public abstract Collection<MethodEntry> getMethods();
8080

81-
Collection<LocalVariableEntry> getParameters();
81+
public abstract Collection<LocalVariableEntry> getParameters();
8282

83-
Collection<FieldEntry> getFields();
83+
public abstract Collection<FieldEntry> getFields();
8484

8585
/**
8686
* Returns all indexed entries, organised into an {@link EntryTree}.
8787
* Note that all entries will have their mapping set to {@code null}.
8888
*
8989
* @return the entry tree
9090
*/
91-
EntryTree<EntryMapping> getTree();
91+
public abstract EntryTree<EntryMapping> getTree();
9292

9393
@Override
94-
default String getTranslationKey() {
94+
public String getTranslationKey() {
9595
return "progress.jar.indexing.process.entries";
9696
}
9797
}

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/IndependentBridgeMethodIndex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import java.util.List;
1717
import java.util.Map;
1818

19-
class IndependentBridgeMethodIndex implements BridgeMethodIndex {
19+
class IndependentBridgeMethodIndex extends BridgeMethodIndex {
2020
private final EntryIndex entryIndex;
2121
private final InheritanceIndex inheritanceIndex;
2222
private final ReferenceIndex referenceIndex;

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/IndependentEntryIndex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import java.util.HashMap;
2020
import java.util.Map;
2121

22-
class IndependentEntryIndex implements EntryIndex {
22+
class IndependentEntryIndex extends EntryIndex {
2323
private final EntryTree<EntryMapping> tree = new HashEntryTree<>();
2424

2525
private final Map<FieldEntry, FieldDefEntry> fieldDefinitions = new HashMap<>();

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/IndependentReferenceIndex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.util.Collection;
1919
import java.util.Map;
2020

21-
class IndependentReferenceIndex implements ReferenceIndex {
21+
class IndependentReferenceIndex extends ReferenceIndex {
2222
private Multimap<MethodEntry, MethodEntry> methodReferences = HashMultimap.create();
2323
private Multimap<MethodEntry, FieldEntry> fieldReferences = HashMultimap.create();
2424

enigma/src/main/java/org/quiltmc/enigma/api/analysis/index/jar/ReferenceIndex.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99

1010
import java.util.Collection;
1111

12-
public interface ReferenceIndex extends JarIndexer {
13-
Collection<MethodEntry> getMethodsReferencedBy(MethodEntry entry);
12+
public abstract class ReferenceIndex implements JarIndexer {
13+
public abstract Collection<MethodEntry> getMethodsReferencedBy(MethodEntry entry);
1414

15-
Collection<FieldEntry> getFieldsReferencedBy(MethodEntry entry);
15+
public abstract Collection<FieldEntry> getFieldsReferencedBy(MethodEntry entry);
1616

17-
Collection<EntryReference<FieldEntry, MethodDefEntry>> getReferencesToField(FieldEntry entry);
17+
public abstract Collection<EntryReference<FieldEntry, MethodDefEntry>> getReferencesToField(FieldEntry entry);
1818

19-
Collection<EntryReference<ClassEntry, MethodDefEntry>> getReferencesToClass(ClassEntry entry);
19+
public abstract Collection<EntryReference<ClassEntry, MethodDefEntry>> getReferencesToClass(ClassEntry entry);
2020

21-
Collection<EntryReference<MethodEntry, MethodDefEntry>> getReferencesToMethod(MethodEntry entry);
21+
public abstract Collection<EntryReference<MethodEntry, MethodDefEntry>> getReferencesToMethod(MethodEntry entry);
2222

23-
Collection<EntryReference<ClassEntry, FieldDefEntry>> getFieldTypeReferencesToClass(ClassEntry entry);
23+
public abstract Collection<EntryReference<ClassEntry, FieldDefEntry>> getFieldTypeReferencesToClass(ClassEntry entry);
2424

25-
Collection<EntryReference<ClassEntry, MethodDefEntry>> getMethodTypeReferencesToClass(ClassEntry entry);
25+
public abstract Collection<EntryReference<ClassEntry, MethodDefEntry>> getMethodTypeReferencesToClass(ClassEntry entry);
2626

2727
@Override
28-
default String getTranslationKey() {
28+
public String getTranslationKey() {
2929
return "progress.jar.indexing.process.references";
3030
}
3131
}

0 commit comments

Comments
 (0)