Skip to content

Commit

Permalink
[JDGUI] Make sure we do not add the opened class into the inner class…
Browse files Browse the repository at this point in the history
…es array.
  • Loading branch information
Bl3nd committed Oct 18, 2024
1 parent a5f3153 commit 756c823
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,19 @@ public JDGUIDecompiler()
super("JD-GUI Decompiler", "jdgui");
}

private String[] inners;
@Override
public String decompileClassNode(ClassNode cn, byte[] bytes)
{
TempFile tempFile = null;
String exception;

List<InnerClassNode> innerClasses = cn.innerClasses;
inners = new String[innerClasses.size()];
String[] inners = new String[innerClasses.size()];
for (int i = 0; i < innerClasses.size(); i++)
{
if (innerClasses.get(i).name.equals(cn.name))
break;

if (innerClasses.get(i).outerName != null && innerClasses.get(i).outerName.equals(cn.name))
{
inners[i] = innerClasses.get(i).name;
Expand All @@ -79,9 +81,7 @@ else if (innerClasses.get(i).outerName == null)
String name = innerClasses.get(i).name;
name = name.substring(name.lastIndexOf('/') + 1);
if (name.contains(cn.name.substring(cn.name.lastIndexOf('/') + 1)))
{
inners[i] = innerClasses.get(i).name;
}
}
}

Expand Down

0 comments on commit 756c823

Please sign in to comment.