I\'m using Javassist to generate a class foo, with method bar, but I can\'t seem to find a way to add an annotation (the annotation itself isn\'t r
foo
bar
Solved it eventually, I was adding the annotation to the wrong place. I wanted to add it to the method, but I was adding it to the class.
This is how the fixed code looks like:
// wrong ccFile.addAttribute(attr); // right mthd.getMethodInfo().addAttribute(attr);