Vasco Vasconcelos
unread,May 17, 2012, 10:36:12 AM5/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mozilla-rhino
Hi,
I'm having difficulties in generating bytecode for abstract methods.
Naively, I was expecting a piece of code such as
classFileWriter.startMethod("foo", "()V",
ClassFileWriter.ACC_ABSTRACT);
classFileWriter.stopMethod((short) 0);
to do the job. But this generates a code attribute together with the
method, which is not supposed to be present in the bytecode for
abstract methods.
When the interpreter loads the bytecode, I get "Exception in thread
"main" java.lang.ClassFormatError: Code attribute in native or
abstract methods in class file AbstractMethod".
I am using, Rhino 1.7R3 and java version "1.6.0_31".
Ideas?