Skip to content

Commit

Permalink
Don't hollow out inner classes in CFR input handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Sep 30, 2024
1 parent 427a873 commit 78093b8
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import jakarta.annotation.Nonnull;
import org.benf.cfr.reader.api.ClassFileSource;
import org.benf.cfr.reader.bytecode.analysis.parse.utils.Pair;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import software.coley.recaf.path.ClassPathNode;
import software.coley.recaf.util.visitors.ClassHollowingVisitor;
import software.coley.recaf.workspace.model.Workspace;

import java.util.Collection;
Expand Down Expand Up @@ -62,14 +59,6 @@ public Pair<byte[], String> getClassFileContent(String inputPath) {
} else {
ClassPathNode result = workspace.findClass(className);
code = result == null ? null : result.getValue().asJvmClass().getBytecode();

// Simply CFR's work-load by gutting supporting class internals
if (code != null) {
ClassWriter writer = new ClassWriter(0);
ClassHollowingVisitor hollower = new ClassHollowingVisitor(writer);
new ClassReader(code).accept(hollower, ClassReader.SKIP_CODE);
code = writer.toByteArray();
}
}
return new Pair<>(code, inputPath);
}
Expand Down

0 comments on commit 78093b8

Please sign in to comment.