diff --git a/jode/jode/bytecode/BasicBlockReader.java b/jode/jode/bytecode/BasicBlockReader.java index 80af89c..c653780 100644 --- a/jode/jode/bytecode/BasicBlockReader.java +++ b/jode/jode/bytecode/BasicBlockReader.java @@ -1,4 +1,4 @@ -/* BasicBlockReader Copyright (C) 1999-20000 Jochen Hoenicke. +/* BasicBlockReader Copyright (C) 1999-2000 Jochen Hoenicke. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -205,7 +205,7 @@ class BasicBlockReader implements Opcodes { } - private void convertHandlers() { + private Handler[] convertHandlers() { int newCount = 0; for (int i=0; i < handlers.length; i++) { if ((infos[handlers[i].catcher].flags & IS_REACHABLE) != 0) @@ -232,7 +232,7 @@ class BasicBlockReader implements Opcodes { handlers[i].type); } } - bb.setExceptionHandlers(newHandlers); + return newHandlers; } private void convertBlock(int firstAddr, int count) { @@ -297,8 +297,7 @@ class BasicBlockReader implements Opcodes { } if (start != -1) convertBlock(start, count); - bb.setBlocks(blocks, getSuccBlock(0)); - convertHandlers(); + bb.setBlocks(blocks, getSuccBlock(0), convertHandlers()); } public void readCode(ConstantPool cp, diff --git a/jode/jode/bytecode/BasicBlockWriter.java b/jode/jode/bytecode/BasicBlockWriter.java index 780c80c..26e5962 100644 --- a/jode/jode/bytecode/BasicBlockWriter.java +++ b/jode/jode/bytecode/BasicBlockWriter.java @@ -1,4 +1,4 @@ -/* BasicBlockWriter Copyright (C) 1999-20000 Jochen Hoenicke. +/* BasicBlockWriter Copyright (C) 1999-2000 Jochen Hoenicke. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/jode/jode/bytecode/BasicBlocks.java b/jode/jode/bytecode/BasicBlocks.java index 6e8db2e..bb960e2 100644 --- a/jode/jode/bytecode/BasicBlocks.java +++ b/jode/jode/bytecode/BasicBlocks.java @@ -161,15 +161,12 @@ public class BasicBlocks extends BinaryInfo { maxLocals = ml; } - public void setBlocks(Block[] blocks, Block startBlock) { + public void setBlocks(Block[] blocks, Block startBlock, + Handler[] handlers) { for (int i = 0; i < blocks.length; i++) blocks[i].blockNr = i; this.blocks = blocks; this.startBlock = startBlock; - this.exceptionHandlers = null; - } - - public void setExceptionHandlers(Handler[] handlers) { exceptionHandlers = handlers.length == 0 ? Handler.EMPTY : handlers; ArrayList activeHandlers = new ArrayList(); for (int i = 0; i < blocks.length; i++) { @@ -185,6 +182,7 @@ public class BasicBlocks extends BinaryInfo { blocks[i].catchers = (Handler[]) activeHandlers.toArray(Handler.EMPTY); } +// TransformSubroutine.createSubroutineInfo(this); } /** diff --git a/jode/jode/bytecode/Instruction.java b/jode/jode/bytecode/Instruction.java index 2adfb05..15d5ae2 100644 --- a/jode/jode/bytecode/Instruction.java +++ b/jode/jode/bytecode/Instruction.java @@ -114,7 +114,7 @@ public class Instruction implements Opcodes{ * @exception IllegalArgumentException if opcode is not opc_ldc or * opc_ldc2_w. */ - public Instruction forOpcode(int opcode, Object constant) { + public static Instruction forOpcode(int opcode, Object constant) { if (opcode == opc_ldc || opcode == opc_ldc2_w) return new ConstantInstruction(opcode, constant); throw new IllegalArgumentException("Instruction has no constant");