Closed ghost closed 11 years ago
Do you have any proposed syntax? My main concern is to find a way to represent all the possible optional attributes in a way that is easy to use and avoids unnecessarily cluttering up the grammar.
@Ltest/TestClass;(value = "Test")
I've added runtime annotation support. Try it now.
By the way, annotations like @Override are source only, so they're not going to show up in the classfile anyway.
Having an issue trying to disassemble now.
Try it now. Sorry I couldn't really test it due to not having any examples of classes with runtime annotations to test it with. But I tested it with ScenterMod so it should work now.
I tested it out and it managed to only do @Mod.PreInit, @Mod.Init, @Mod.PostInit which are methods. But it missed the two used for the class along w/ the two used for the class fields. When I did a reassemble it didn't place anything w/ the annotations. I also noticed there is another Class Attribute called InnerClasses that might have to be used w/ reassembly.
Sorry, RuntimeAnnotations are currently only implemented for methods. I would add them for classes and fields, but I'm still investigating a good way to do this. The problem is that fields are currently only a single line, with no obvious way to add attributes.
InnerClasses is a seperate attribute, but I can add support for that once the class/field thing is cleared up.
I just discovered several more bugs in the assembler. I'll upload everything once I'm done adding support for the other attributes and testing to try to find any more bugs that might be hiding.
Everything should be working now. The disassembler now supports all defined attributes except for LineNumberTable, LocalVariableTable, and LocalVariableTypeTable, though contentless ones like Deprecated are handled through the generic attribute syntax.
I love this tool that you made and works much better then having to use JBE to edit Java Bytecode to make modifications w/o a recompile. The only issue I have is that some of the things I have to modify use Runtime Annotations either w/ @Override or custom interfaces.