Class ListIndexedIterating.ForLoop

java.lang.Object
com.mebigfatguy.fbcontrib.detect.ListIndexedIterating.ForLoop
Enclosing class:
ListIndexedIterating

static class ListIndexedIterating.ForLoop extends Object
represents a for loop
  • Field Details

    • loopStart

      private int loopStart
    • loopEnd

      private int loopEnd
    • loopReg

      private int loopReg
    • loopState

      private ListIndexedIterating.LoopState loopState
    • loopRegLoaded

      private boolean loopRegLoaded
    • loopCollectionItem

      private edu.umd.cs.findbugs.OpcodeStack.Item loopCollectionItem
  • Constructor Details

    • ForLoop

      public ForLoop(int start, int end, int reg)
      constructs a for loop information block
      Parameters:
      start - the start of the for loop
      end - the end of the for loop
      reg - the loop register
  • Method Details

    • getLoopStart

      public int getLoopStart()
      get the start pc of the loop
      Returns:
      the start pc of the loop
    • getLoopEnd

      public int getLoopEnd()
      get the end pc of the loop
      Returns:
      the end pc of the loop
    • getLoopReg

      public int getLoopReg()
      get the loop register
      Returns:
      the loop register
    • setLoopState

      public void setLoopState(ListIndexedIterating.LoopState state)
      sets the current state of the for loop
      Parameters:
      state - the new state
    • getLoopState

      public ListIndexedIterating.LoopState getLoopState()
      get the current phase of the for loop
      Returns:
      the current state
    • setLoopRegLoaded

      public void setLoopRegLoaded(boolean loaded)
      mark that the loop register has been loaded with an iload instruction
      Parameters:
      loaded - the flag of whether the loop register is loaded
    • getLoopRegLoaded

      public boolean getLoopRegLoaded()
      returns whether the loop register is on the top of the stack
      Returns:
      whether the loop register is on the top of the stack
    • isSecondItem

      public boolean isSecondItem(edu.umd.cs.findbugs.OpcodeStack.Item itm)
      returns whether this is the second time the loop register is found
      Parameters:
      itm - the item on the stack
      Returns:
      whether this is the second time the loop register is found