jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koduru, Rajendra Kumar Reddy" <rajendra.kumar.reddy.kod...@sap.com>
Subject RE: Problem with instrumentation in constructors
Date Thu, 17 Feb 2005 16:24:49 GMT
Hi Andrew,

>> 	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"?

	
	when I used superList = iList.copy(); 

	the isntruction handle returned was ih =  -1

	and when I called iList.insert(ih.next(), newList);
	
	I could not see my instrumented instructions in the bytecode
instruction set.

	But, when I used the iList itself for iteration. ih = 1

	iList.insert(ih.next(),newList);	

	I could see my instrumented instructions in desired place.

	I was wondering why it is so??



>
>> 
>> 	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
>
>

---------------------------------------------------------------------
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