edu.umd.cs.findbugs

Class OpcodeStack

public class OpcodeStack extends Object implements Constants2

tracks the types and numbers of objects that are currently on the operand stack throughout the execution of method. To use, a detector should instantiate one for each method, and call

stack.sawOpcode(this,seen);

at the bottom of their sawOpcode method. at any point you can then inspect the stack and see what the types of objects are on the stack, including constant values if they were pushed. The types described are of course, only the static types. There are some outstanding opcodes that have yet to be implemented, I couldn't find any code that actually generated these, so i didn't put them in because I couldn't test them:
Nested Class Summary
static classOpcodeStack.Item
Constructor Summary
OpcodeStack()
Method Summary
voidclear()
static StringgetExceptionSig(DismantleBytecode dbc, CodeException e)
intgetLastUpdate(int reg)
intgetNumLastUpdates()
intgetStackDepth()
OpcodeStack.ItemgetStackItem(int stackOffset)
voidmergeJumps(DismantleBytecode dbc)
intresetForMethodEntry(DismantleBytecode v)
voidsawOpcode(DismantleBytecode dbc, int seen)

Constructor Detail

OpcodeStack

public OpcodeStack()

Method Detail

clear

public void clear()

getExceptionSig

public static String getExceptionSig(DismantleBytecode dbc, CodeException e)

getLastUpdate

public int getLastUpdate(int reg)

getNumLastUpdates

public int getNumLastUpdates()

getStackDepth

public int getStackDepth()

getStackItem

public OpcodeStack.Item getStackItem(int stackOffset)

mergeJumps

public void mergeJumps(DismantleBytecode dbc)

resetForMethodEntry

public int resetForMethodEntry(DismantleBytecode v)

sawOpcode

public void sawOpcode(DismantleBytecode dbc, int seen)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.