File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
enigma/src/main/java/org/quiltmc/enigma Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 77import java .util .ArrayList ;
88import java .util .Collection ;
99import java .util .Collections ;
10+ import java .util .HashSet ;
11+ import java .util .Set ;
1012
1113public class ProjectClassProvider implements ClassProvider {
1214 @ Nullable
@@ -78,11 +80,11 @@ public Collection<String> getClassNames() {
7880 return this .classNames ;
7981 }
8082
81- public Collection <String > getMainClassNames () {
82- return this .main != null ? this .main .getClassNames () : Collections .emptySet ();
83+ public Set <String > getMainClassNames () {
84+ return this .main != null ? new HashSet <>( this .main .getClassNames () ) : Collections .emptySet ();
8385 }
8486
85- public Collection <String > getLibraryClassNames () {
86- return this .libraries != null ? this .libraries .getClassNames () : Collections .emptySet ();
87+ public Set <String > getLibraryClassNames () {
88+ return this .libraries != null ? new HashSet <>( this .libraries .getClassNames () ) : Collections .emptySet ();
8789 }
8890}
Original file line number Diff line number Diff line change 66import org .quiltmc .enigma .api .class_provider .ProjectClassProvider ;
77
88import javax .annotation .Nullable ;
9- import java .util .Collection ;
9+ import java .util .Set ;
1010
1111/**
1212 * Jar indexer services analyse jar files as they're opened to collect information about their contents.
@@ -35,7 +35,7 @@ static boolean shouldIndexLibraries(@Nullable EnigmaServiceContext<JarIndexerSer
3535 * @param classProvider a provider to translate class names into {@link ClassNode class nodes}. Contains both library and main jar classes
3636 * @param jarIndex the current jar index
3737 */
38- void acceptJar (Collection <String > scope , ProjectClassProvider classProvider , JarIndex jarIndex );
38+ void acceptJar (Set <String > scope , ProjectClassProvider classProvider , JarIndex jarIndex );
3939
4040 /**
4141 * Whether this indexer should be run on libraries in addition to the main project being indexed.
@@ -69,7 +69,7 @@ static JarIndexerService fromVisitor(@Nullable EnigmaServiceContext<JarIndexerSe
6969
7070 return new JarIndexerService () {
7171 @ Override
72- public void acceptJar (Collection <String > scope , ProjectClassProvider classProvider , JarIndex jarIndex ) {
72+ public void acceptJar (Set <String > scope , ProjectClassProvider classProvider , JarIndex jarIndex ) {
7373 for (String className : scope ) {
7474 ClassNode node = classProvider .get (className );
7575 if (node != null ) {
Original file line number Diff line number Diff line change 2525import org .quiltmc .enigma .api .translation .representation .entry .ParentedEntry ;
2626import org .quiltmc .enigma .util .I18n ;
2727
28- import java .util .Collection ;
2928import java .util .HashSet ;
3029import java .util .LinkedHashMap ;
3130import java .util .Map ;
@@ -76,7 +75,7 @@ public <T extends JarIndexer> T getIndex(Class<T> clazz) {
7675 * @param classProvider a class provider containing all classes in the jar
7776 * @param progress a progress listener to track index completion
7877 */
79- public void indexJar (Collection <String > classNames , ClassProvider classProvider , ProgressListener progress ) {
78+ public void indexJar (Set <String > classNames , ClassProvider classProvider , ProgressListener progress ) {
8079 // for use in processIndex
8180 this .progress = progress ;
8281
You can’t perform that action at this time.
0 commit comments