Skip to content

Commit

Permalink
Fix some confusing names
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Apr 5, 2024
1 parent b26682b commit 1ec7fff
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import cuchaz.enigma.translation.representation.entry.LocalVariableEntry;
import cuchaz.enigma.translation.representation.entry.MethodEntry;

public class EnigmaDumper extends StringStreamDumper {
public class CfrDumper extends StringStreamDumper {
private final StringBuilder sb;
private final SourceSettings sourceSettings;
private final SourceIndex index;
Expand All @@ -51,11 +51,11 @@ public class EnigmaDumper extends StringStreamDumper {
private boolean muteLine = false;
private MethodEntry contextMethod = null;

public EnigmaDumper(StringBuilder sb, SourceSettings sourceSettings, TypeUsageInformation typeUsage, Options options, @Nullable EntryRemapper mapper) {
public CfrDumper(StringBuilder sb, SourceSettings sourceSettings, TypeUsageInformation typeUsage, Options options, @Nullable EntryRemapper mapper) {
this(sb, sourceSettings, typeUsage, options, mapper, new SourceIndex(), new MovableDumperContext());
}

protected EnigmaDumper(StringBuilder sb, SourceSettings sourceSettings, TypeUsageInformation typeUsage, Options options, @Nullable EntryRemapper mapper, SourceIndex index, MovableDumperContext context) {
protected CfrDumper(StringBuilder sb, SourceSettings sourceSettings, TypeUsageInformation typeUsage, Options options, @Nullable EntryRemapper mapper, SourceIndex index, MovableDumperContext context) {
super((m, e) -> {
}, sb, typeUsage, options, IllegalIdentifierDump.Nop.getInstance(), context);
this.sb = sb;
Expand Down Expand Up @@ -393,7 +393,7 @@ private void dumpClass(TypeContext context, JavaTypeInstance type, boolean defin
*/
@Override
public Dumper withTypeUsageInformation(TypeUsageInformation innerclassTypeUsageInformation) {
return new EnigmaDumper(this.sb, sourceSettings, innerclassTypeUsageInformation, options, mapper, index, dumperContext);
return new CfrDumper(this.sb, sourceSettings, innerclassTypeUsageInformation, options, mapper, index, dumperContext);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private void ensureDecompiled() {
TypeUsageCollectingDumper typeUsageCollector = new TypeUsageCollectingDumper(options, tree);
tree.analyseTop(state, typeUsageCollector);

EnigmaDumper dumper = new EnigmaDumper(new StringBuilder(), settings, typeUsageCollector.getRealTypeUsageInformation(), options, mapper);
CfrDumper dumper = new CfrDumper(new StringBuilder(), settings, typeUsageCollector.getRealTypeUsageInformation(), options, mapper);
tree.dump(state.getObfuscationMapping().wrap(dumper));
index = dumper.getIndex();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import cuchaz.enigma.classprovider.ClassProvider;
import cuchaz.enigma.utils.AsmUtil;

class EnigmaContextSource implements IContextSource {
class VineflowerContextSource implements IContextSource {
private final IContextSource classpathSource = new ClasspathSource();
private final ClassProvider classProvider;
private final String className;
private Entries entries;

EnigmaContextSource(ClassProvider classProvider, String className) {
VineflowerContextSource(ClassProvider classProvider, String className) {
this.classProvider = classProvider;
this.className = className;
}
Expand Down Expand Up @@ -87,7 +87,7 @@ public void begin() { }

@Override
public void acceptClass(String qualifiedName, String fileName, String content, int[] mapping) {
if (qualifiedName.equals(EnigmaContextSource.this.className)) {
if (qualifiedName.equals(VineflowerContextSource.this.className)) {
saver.saveClassFile(null, qualifiedName, fileName, content, mapping);
}
}
Expand All @@ -106,7 +106,7 @@ public void close() { }
public class ClasspathSource implements IContextSource {
@Override
public String getName() {
return "Enigma-provided classpath context for " + EnigmaContextSource.this.className;
return "Enigma-provided classpath context for " + VineflowerContextSource.this.className;
}

@Override
Expand All @@ -121,7 +121,7 @@ public boolean isLazy() {

@Override
public InputStream getInputStream(String resource) {
return EnigmaContextSource.this.getInputStream(resource);
return VineflowerContextSource.this.getInputStream(resource);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public VineflowerDecompiler(ClassProvider classProvider, SourceSettings sourceSe

@Override
public Source getSource(String className, @Nullable EntryRemapper remapper) {
return new VineflowerSource(new EnigmaContextSource(classProvider, className), remapper, settings);
return new VineflowerSource(new VineflowerContextSource(classProvider, className), remapper, settings);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import cuchaz.enigma.translation.representation.entry.LocalVariableEntry;
import cuchaz.enigma.translation.representation.entry.MethodEntry;

class EnigmaJavadocProvider implements IFabricJavadocProvider {
class VineflowerJavadocProvider implements IFabricJavadocProvider {
private final EntryRemapper remapper;

EnigmaJavadocProvider(EntryRemapper remapper) {
VineflowerJavadocProvider(EntryRemapper remapper) {
this.remapper = remapper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class VineflowerSource implements Source {
private EntryRemapper remapper;
private SourceIndex index;

VineflowerSource(EnigmaContextSource contextSource, EntryRemapper remapper, SourceSettings settings) {
VineflowerSource(VineflowerContextSource contextSource, EntryRemapper remapper, SourceSettings settings) {
this.contextSource = contextSource;
this.librarySource = contextSource.getClasspath();
this.remapper = remapper;
Expand Down Expand Up @@ -61,7 +61,7 @@ private void ensureDecompiled() {
preferences.put(IFernflowerPreferences.INDENT_STRING, "\t");
preferences.put(IFernflowerPreferences.LOG_LEVEL, IFernflowerLogger.Severity.WARN.name());
preferences.put(IFernflowerPreferences.THREADS, String.valueOf(Math.max(1, Runtime.getRuntime().availableProcessors() - 2)));
preferences.put(IFabricJavadocProvider.PROPERTY_NAME, new EnigmaJavadocProvider(remapper));
preferences.put(IFabricJavadocProvider.PROPERTY_NAME, new VineflowerJavadocProvider(remapper));

if (settings.removeImports) {
preferences.put(IFernflowerPreferences.REMOVE_IMPORTS, "1");
Expand All @@ -72,9 +72,9 @@ private void ensureDecompiled() {
IFernflowerLogger logger = new PrintStreamLogger(System.out);
BaseDecompiler decompiler = new BaseDecompiler(saver, preferences, logger);

AtomicReference<EnigmaTextTokenCollector> tokenCollector = new AtomicReference<>();
AtomicReference<VineflowerTextTokenCollector> tokenCollector = new AtomicReference<>();
TextTokenVisitor.addVisitor(next -> {
tokenCollector.set(new EnigmaTextTokenCollector(next));
tokenCollector.set(new VineflowerTextTokenCollector(next));
return tokenCollector.get();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import cuchaz.enigma.translation.representation.entry.LocalVariableEntry;
import cuchaz.enigma.translation.representation.entry.MethodEntry;

class EnigmaTextTokenCollector extends TextTokenVisitor {
class VineflowerTextTokenCollector extends TextTokenVisitor {
private final Map<Token, Entry<?>> declarations = new HashMap<>();
private final Map<Token, Pair<Entry<?>, Entry<?>>> references = new HashMap<>();
private final Set<Token> tokens = new LinkedHashSet<>();
private String content;
private MethodEntry currentMethod;

EnigmaTextTokenCollector(TextTokenVisitor next) {
VineflowerTextTokenCollector(TextTokenVisitor next) {
super(next);
}

Expand Down

0 comments on commit 1ec7fff

Please sign in to comment.