From a597bbeae63dfe52674f4ccb63dc302fee8ea99d Mon Sep 17 00:00:00 2001 From: Runemoro Date: Sat, 2 Nov 2019 17:18:24 -0400 Subject: Fix array class translation (#173) --- .../cuchaz/enigma/translation/representation/entry/ClassEntry.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java b/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java index 9bfcd8a..6bf4f96 100644 --- a/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java +++ b/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java @@ -16,6 +16,7 @@ import cuchaz.enigma.throwables.IllegalNameException; import cuchaz.enigma.translation.Translator; import cuchaz.enigma.translation.mapping.EntryMapping; import cuchaz.enigma.translation.mapping.NameValidator; +import cuchaz.enigma.translation.representation.TypeDescriptor; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -62,6 +63,11 @@ public class ClassEntry extends ParentedEntry implements Comparable< @Override public ClassEntry translate(Translator translator, @Nullable EntryMapping mapping) { + if (name.charAt(0) == '[') { + String translatedName = translator.translate(new TypeDescriptor(name)).toString(); + return new ClassEntry(parent, translatedName); + } + String translatedName = mapping != null ? mapping.getTargetName() : name; return new ClassEntry(parent, translatedName); } -- cgit v1.2.3