Class BytecodeScanner

java.lang.Object
edu.umd.cs.findbugs.ba.BytecodeScanner

public class BytecodeScanner extends 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 
    Callback interface to report scanned instructions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final boolean
     
    private static final int[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEBUG

      private static final boolean DEBUG
    • PAD

      private static final int[] PAD
  • Constructor Details

    • BytecodeScanner

      public BytecodeScanner()
  • Method Details

    • 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 array
      offset - the offset in the array
    • scan

      public void scan(byte[] instructionList, BytecodeScanner.Callback callback)
      Scan the raw bytecodes of a method.
      Parameters:
      instructionList - the bytecodes
      callback - the callback object