Search in sources :

Example 1 with InstructionRange

use of org.candle.decompiler.instruction.InstructionRange in project candle-decompiler by bradsdavis.

the class InstructionTryCatch method process.

public void process() {
    Map<InstructionRange, List<CodeExceptionGen>> tryRangeGen = new HashMap<InstructionRange, List<CodeExceptionGen>>();
    //create try statements...
    for (CodeExceptionGen ceg : exceptions) {
        InstructionHandle min = (ceg.getStartPC());
        InstructionHandle max = (ceg.getEndPC());
        InstructionRange tryRange = new InstructionRange();
        tryRange.setStart(min);
        tryRange.setEnd(max);
        //SKIP THE FINALLY
        if (ceg.getCatchType() == null) {
            continue;
        }
        if (!tryRangeGen.containsKey(tryRange)) {
            tryRangeGen.put(tryRange, new LinkedList<CodeExceptionGen>());
        }
        tryRangeGen.get(tryRange).add(ceg);
    }
}
Also used : HashMap(java.util.HashMap) List(java.util.List) LinkedList(java.util.LinkedList) CodeExceptionGen(org.apache.bcel.generic.CodeExceptionGen) InstructionHandle(org.apache.bcel.generic.InstructionHandle) InstructionRange(org.candle.decompiler.instruction.InstructionRange)

Aggregations

HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 CodeExceptionGen (org.apache.bcel.generic.CodeExceptionGen)1 InstructionHandle (org.apache.bcel.generic.InstructionHandle)1 InstructionRange (org.candle.decompiler.instruction.InstructionRange)1