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:seb...@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-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to