jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Huntwork <...@huntwork.net>
Subject Re: Problem with instrumentation in constructors
Date Thu, 17 Feb 2005 15:33:59 GMT
Koduru, Rajendra Kumar Reddy wrote:
> Hi Andrew,
> 	
> 	Yep, I have seen your objections to the instrumentaion procedure
> of constructor that was mentioned by you in the corresponding thread..
> 
> 	The approach you suggested worked, but with a small change... 
> 	In the getIListSuper() method, instead of using superList as
> mentioned 
> 	
> 	superList = iList.copy(); I used
> 	iList itself in this method..

oh yeah, good point.


> 
> 	the former was returning instruction handle -1 and the later +1,
> with a basic super() being first call.

I don't understand your current problem.  Are you saying that the 
InstructionHandle you're returning is not correct?  Is off by one?  what 
do you mean by "was not able to insert"?

> 
> 	and was not able to insert with former..so choosed the
> later..however am not sure of reason for this..could you please clarify
> me, why is this happening..is this due to copy()
> method???????????????????????
> 
> public InstructionHandle getIListSuper(InstructionList iList){
>      
>      int invkSpec = 0;
>  
>      InstructionHandle seperator = null;
>     
>      InstructionList superList = iList.copy(); // deep copy
> [COMMENTED OUT IN CURRENT METHOD]
>      
>      for ( Iterator i = superList.iterator (); i.hasNext (); ) {
> [ USED iList in place of superList in this statement]
>        seperator = ( InstructionHandle ) i.next ();
>  
>        if(seperator.getInstruction() instanceof NEW )
>            invkSpec++;
>  
>        if(seperator.getInstruction() instanceof INVOKESPECIAL )
>          invkSpec--;
>  
>        if(invkSpec < 0 )
>          break;
>      }
>      
>      if(invkSpec < 0) {
>      return seperator
>      }
>    
>  	  return null;
>      }
> 
> 
> Thank you
> Reddy

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Mime
View raw message