Package edu.umd.cs.findbugs.ba
Class BytecodeScanner
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.BytecodeScanner
-
public class BytecodeScanner extends java.lang.Object
Scan the raw bytecodes of a method. This is useful in order to find out quickly whether or not a method uses particular instructions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BytecodeScanner.Callback
Callback interface to report scanned instructions.
-
Constructor Summary
Constructors Constructor Description BytecodeScanner()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
extractInt(byte[] arr, int offset)
Extract an int from bytes at the given offset in the array.void
scan(byte[] instructionList, BytecodeScanner.Callback callback)
Scan the raw bytecodes of a method.private static short
unsignedValueOf(byte value)
Convert the unsigned value of a byte into a short.
-
-
-
Method Detail
-
unsignedValueOf
private static short unsignedValueOf(byte value)
Convert the unsigned value of a byte into a short.- Parameters:
value
- the byte- Returns:
- the byte's unsigned value as a short
-
extractInt
private static int extractInt(byte[] arr, int offset)
Extract an int from bytes at the given offset in the array.- Parameters:
arr
- the arrayoffset
- the offset in the array
-
scan
public void scan(byte[] instructionList, BytecodeScanner.Callback callback)
Scan the raw bytecodes of a method.- Parameters:
instructionList
- the bytecodescallback
- the callback object
-
-