Skip to content

Commit 34285c2

Browse files
committed
fix (somehow many?) bugs occurring on (seemingly only) Windows
1 parent 36515d0 commit 34285c2

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

pom.xml

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

44
<groupId>the.bytecode.club</groupId>
55
<artifactId>Bytecode-Viewer</artifactId>
6-
<version>2.10.16</version>
6+
<version>2.10.17</version>
77

88
<properties>
99
<!-- Project settings -->

src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MethodsRenderer.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package the.bytecode.club.bytecodeviewer.gui.components;
22

33
import java.awt.Component;
4+
import java.util.List;
45
import javax.swing.JLabel;
56
import javax.swing.JList;
67
import javax.swing.ListCellRenderer;
8+
9+
import the.bytecode.club.bytecodeviewer.gui.resourceviewer.BytecodeViewPanel;
710
import the.bytecode.club.bytecodeviewer.gui.util.BytecodeViewPanelUpdater;
811
import the.bytecode.club.bytecodeviewer.util.MethodParser;
912

@@ -44,8 +47,16 @@ public MethodsRenderer(BytecodeViewPanelUpdater bytecodeViewPanelUpdater)
4447
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected,
4548
boolean cellHasFocus)
4649
{
47-
MethodParser methods = bytecodeViewPanelUpdater.viewer.methods.get(bytecodeViewPanelUpdater.bytecodeViewPanel.decompiler.ordinal());
48-
MethodParser.Method method = methods.getMethod((Integer) value);
50+
int methodIndex = (Integer) value;
51+
MethodParser methods;
52+
List<MethodParser> methodParsers = bytecodeViewPanelUpdater.viewer.methods;
53+
BytecodeViewPanel bytecodeViewPanel = bytecodeViewPanelUpdater.bytecodeViewPanel;
54+
try {
55+
methods = methodParsers.get(bytecodeViewPanel.decompiler.ordinal());
56+
} catch (ArrayIndexOutOfBoundsException e) {
57+
methods = methodParsers.get(bytecodeViewPanel.panelIndex);
58+
}
59+
MethodParser.Method method = methods.getMethod(methodIndex);
4960
setText(method.toString());
5061
return this;
5162
}

0 commit comments

Comments
 (0)