Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Using the Assembler on classes annotated with annotations (that are annotated with RetentionPolicy.RUNTIME) strips it #140

Closed
mdo992 opened this issue Jan 31, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@mdo992
Copy link

mdo992 commented Jan 31, 2023

I have a class that looks like this:

@TestAnnotation(
    test1 = "a",
    test2 = "a test",
    test3 = "a real test"
)
public class TestClass {
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface TestAnnotation {
    String test1();

    String test2();

    String test3();
}

I decompile jar, open it in Recaf's assembler and save the bytecode without modifying anything. Closing the assembler and opening the class in the assembler again changes the bytecode and the annotation gets stripped:

image

@Col-E
Copy link
Owner

Col-E commented Jan 31, 2023

@Nowilltolife This is fixed on dev3 right?

@Col-E Col-E added the bug Something isn't working label Jan 31, 2023
@jumanji144
Copy link

i do not see a reason why it should strip them, newest dev3 parses all annotations

@mdo992
Copy link
Author

mdo992 commented Jan 31, 2023

I believe I was testing on 3.0.0, i’ll try the latest commit and let you know how it goes later.

@mdo992
Copy link
Author

mdo992 commented Jan 31, 2023

This appears to be fixed on the latest commit but it also changes the order here, if that mattered:
image

@mdo992 mdo992 closed this as completed Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants