Lines 21-26
Link Here
|
21 |
import java.util.Hashtable; |
21 |
import java.util.Hashtable; |
22 |
import java.util.List; |
22 |
import java.util.List; |
23 |
import java.util.Stack; |
23 |
import java.util.Stack; |
|
|
24 |
|
24 |
import org.apache.bcel.Constants; |
25 |
import org.apache.bcel.Constants; |
25 |
import org.apache.bcel.classfile.AnnotationEntry; |
26 |
import org.apache.bcel.classfile.AnnotationEntry; |
26 |
import org.apache.bcel.classfile.Annotations; |
27 |
import org.apache.bcel.classfile.Annotations; |
Lines 179-184
Link Here
|
179 |
((m.getAccessFlags() & (Constants.ACC_ABSTRACT | Constants.ACC_NATIVE)) == 0) |
180 |
((m.getAccessFlags() & (Constants.ACC_ABSTRACT | Constants.ACC_NATIVE)) == 0) |
180 |
? new InstructionList(m.getCode().getCode()) |
181 |
? new InstructionList(m.getCode().getCode()) |
181 |
: null, cp); |
182 |
: null, cp); |
|
|
183 |
// remove dummy variables created with regular constructor |
184 |
this.removeLocalVariables(); |
185 |
|
182 |
Attribute[] attributes = m.getAttributes(); |
186 |
Attribute[] attributes = m.getAttributes(); |
183 |
for (int i = 0; i < attributes.length; i++) { |
187 |
for (int i = 0; i < attributes.length; i++) { |
184 |
Attribute a = attributes[i]; |
188 |
Attribute a = attributes[i]; |
Lines 345-350
Link Here
|
345 |
* Remove all local variables. |
349 |
* Remove all local variables. |
346 |
*/ |
350 |
*/ |
347 |
public void removeLocalVariables() { |
351 |
public void removeLocalVariables() { |
|
|
352 |
for (LocalVariableGen var : variable_vec) |
353 |
var.removeTargets(); |
348 |
variable_vec.clear(); |
354 |
variable_vec.clear(); |
349 |
} |
355 |
} |
350 |
|
356 |
|
Lines 393-401
Link Here
|
393 |
for (int i = 0; i < size; i++) { |
399 |
for (int i = 0; i < size; i++) { |
394 |
if (lg[i].getStart() == null) { |
400 |
if (lg[i].getStart() == null) { |
395 |
lg[i].setStart(il.getStart()); |
401 |
lg[i].setStart(il.getStart()); |
|
|
402 |
} else { |
403 |
lg[i].setStart(il.findHandle(lg[i].getStart().i_position)); |
396 |
} |
404 |
} |
397 |
if (lg[i].getEnd() == null) { |
405 |
if (lg[i].getEnd() == null) { |
398 |
lg[i].setEnd(il.getEnd()); |
406 |
lg[i].setEnd(il.getEnd()); |
|
|
407 |
} else { |
408 |
lg[i].setEnd(il.findHandle(lg[i].getEnd().i_position)); |
399 |
} |
409 |
} |
400 |
} |
410 |
} |
401 |
if (size > 1) { |
411 |
if (size > 1) { |
Lines 404-410
Link Here
|
404 |
return lg; |
414 |
return lg; |
405 |
} |
415 |
} |
406 |
|
416 |
|
407 |
|
|
|
408 |
/** |
417 |
/** |
409 |
* @return `LocalVariableTable' attribute of all the local variables of this method. |
418 |
* @return `LocalVariableTable' attribute of all the local variables of this method. |
410 |
*/ |
419 |
*/ |
Lines 468-474
Link Here
|
468 |
LineNumber[] ln = new LineNumber[size]; |
477 |
LineNumber[] ln = new LineNumber[size]; |
469 |
try { |
478 |
try { |
470 |
for (int i = 0; i < size; i++) { |
479 |
for (int i = 0; i < size; i++) { |
471 |
ln[i] = line_number_vec.get(i).getLineNumber(); |
480 |
LineNumberGen lng = line_number_vec.get(i); |
|
|
481 |
if (! il.contains(lng.getInstruction())) { |
482 |
lng.setInstruction(il.findHandle(lng.getInstruction().i_position)); |
483 |
} |
484 |
ln[i] = lng.getLineNumber(); |
472 |
} |
485 |
} |
473 |
} catch (ArrayIndexOutOfBoundsException e) { |
486 |
} catch (ArrayIndexOutOfBoundsException e) { |
474 |
} // Never occurs |
487 |
} // Never occurs |