Skip to content

Commit d13a342

Browse files
committed
fix: Phantom annotation classes not generated properly
Invalid flags, inner classes totally busted, missing retention policy.
1 parent 487d4a6 commit d13a342

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>me.coley</groupId>
44
<artifactId>recaf</artifactId>
55
<url>https://github.com/Col-E/Recaf/</url>
6-
<version>2.20.2</version>
6+
<version>2.20.3</version>
77
<name>Recaf</name>
88
<description>A modern java bytecode editor</description>
99
<!-- Variables -->
@@ -18,7 +18,7 @@
1818
<junit.version>5.7.0</junit.version>
1919
<pico.version>4.6.1</pico.version>
2020
<jline.version>3.20.0</jline.version>
21-
<jp.version>3.20.0</jp.version>
21+
<jp.version>3.23.0</jp.version>
2222
<jfx.version>16</jfx.version>
2323
<spotbugs.version>4.0.0</spotbugs.version>
2424
<spotbugs-mvn.version>3.1.12.2</spotbugs-mvn.version>
@@ -93,7 +93,7 @@
9393
<dependency>
9494
<groupId>com.github.Col-E</groupId>
9595
<artifactId>jphantom</artifactId>
96-
<version>1.4.2</version>
96+
<version>1.4.3</version>
9797
</dependency>
9898
<!-- https://mvnrepository.com/artifact/com.github.javaparser/javaparser-core -->
9999
<dependency>

src/main/java/me/coley/recaf/Recaf.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @author Matt
3232
*/
3333
public class Recaf {
34-
public static final String VERSION = "2.20.2";
34+
public static final String VERSION = "2.20.3";
3535
public static final String DOC_URL = "https://col-e.github.io/Recaf-documentation/";
3636
public static final int ASM_VERSION = Opcodes.ASM9;
3737
private static Controller currentController;

src/main/java/me/coley/recaf/workspace/PhantomResource.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import me.coley.recaf.Recaf;
44
import me.coley.recaf.command.impl.Export;
5-
import me.coley.recaf.util.AccessFlag;
65
import me.coley.recaf.util.ClassUtil;
76
import me.coley.recaf.util.Log;
87
import me.coley.recaf.util.TypeUtil;
@@ -192,18 +191,11 @@ private static ClassHierarchy clsHierarchyFromArchive(JarFile file) throws IOExc
192191
private byte[] decorate(byte[] generated) {
193192
ClassWriter cw = new ClassWriter(0);
194193
ClassVisitor cv = new ClassVisitor(Recaf.ASM_VERSION, cw) {
195-
@Override
196-
public void visit(int version, int access, String name, String signature,
197-
String superName, String[] interfaces) {
198-
if (AccessFlag.isAnnotation(access) && "java/lang/Object".equals(superName))
199-
superName = "java/lang/annotation/Annotation";
200-
super.visit(version, access, name, signature, superName, interfaces);
201-
}
202-
203194
@Override
204195
public void visitEnd() {
205196
visitAnnotation("LAutoGenerated;", true)
206197
.visit("msg", "Recaf/JPhantom automatically generated this class");
198+
super.visitEnd();
207199
}
208200
};
209201
new ClassReader(generated).accept(cv, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);

0 commit comments

Comments
 (0)