From 2eb7d2b83a397d4d276c882107fc50ddd7ce866a Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 16 Sep 2021 14:35:13 +0100 Subject: Improve record class detection (#428) Also generate a method mapping for the record entry, does not support the case of the method having a diffrent name from the field. If there is a component this is remapped via the field mapping.--- enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'enigma-swing/src') diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java index 28b4043e..3b8ecbc5 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/util/GuiUtil.java @@ -20,6 +20,7 @@ import javax.swing.tree.TreePath; import com.formdev.flatlaf.extras.FlatSVGIcon; import com.google.common.collect.Lists; +import cuchaz.enigma.analysis.index.EntryIndex; import cuchaz.enigma.gui.Gui; import cuchaz.enigma.translation.representation.AccessFlags; import cuchaz.enigma.translation.representation.entry.ClassEntry; @@ -119,7 +120,8 @@ public class GuiUtil { } public static Icon getClassIcon(Gui gui, ClassEntry entry) { - AccessFlags access = gui.getController().project.getJarIndex().getEntryIndex().getClassAccess(entry); + EntryIndex entryIndex = gui.getController().project.getJarIndex().getEntryIndex(); + AccessFlags access = entryIndex.getClassAccess(entry); if (access != null) { if (access.isAnnotation()) { @@ -128,7 +130,7 @@ public class GuiUtil { return INTERFACE_ICON; } else if (access.isEnum()) { return ENUM_ICON; - } else if (access.isRecord()) { + } else if (entryIndex.getDefinition(entry).isRecord()) { return RECORD_ICON; } } -- cgit v1.2.3