commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Roberts" <mar...@cs.washington.edu>
Subject RE: BCEL design goals? (was RE: [jira] [Commented] (BCEL-233) The access_flags field in AccessFlags class should be final)
Date Mon, 17 Aug 2015 15:37:13 GMT
That's a little tricky to answer.  As one example, look at generic/LocalVariableInstruction.
 Neither the index or opcode is final.  A user needs to be able to insert new local variables
and hence they need to be able to modify the local variable offset (index).  And 'beneath
the covers' BCEL will modify the opcode if the index changes from one side of the single byte
opcode to the other.  E.g., it will change an 'aload_<n>' to an 'aload'; thus changing
both the opcode and the length of the instruction.

As a general rule, you might try to say you can only replace an instruction rather than modify
it.  Personally, I think that is too restrictive.


-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Sunday, August 16, 2015 5:17 AM
To: Commons Developers List
Subject: Re: BCEL design goals? (was RE: [jira] [Commented] (BCEL-233) The access_flags field
in AccessFlags class should be final)

I think it's still an error to change certain aspects of an Instruction class.
For example, the opcode and length are fixed for a particular instruction type.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message