Class FieldCouldBeLocal.BlockState

  • Enclosing class:
    FieldCouldBeLocal

    private static class FieldCouldBeLocal.BlockState
    extends java.lang.Object
    holds the parse state of the current basic block, and what fields are left to be checked the fields that are left to be checked are a reference from the parent block and a new collection is created on first write to the set to reduce memory concerns.
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockState​(edu.umd.cs.findbugs.ba.BasicBlock bb, FieldCouldBeLocal.BlockState parentBlockState)
      creates a BlockState consisting of the next basic block to parse, and what fields are to be checked
      BlockState​(edu.umd.cs.findbugs.ba.BasicBlock bb, java.util.Set<java.lang.String> fields)
      creates a BlockState consisting of the next basic block to parse, and what fields are to be checked
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      edu.umd.cs.findbugs.ba.BasicBlock getBasicBlock()
      get the basic block to parse
      int getUncheckedFieldSize()
      returns the number of unchecked fields
      boolean removeUncheckedField​(java.lang.String field)
      return the field from the set of unchecked fields if this occurs make a copy of the set on write to reduce memory usage
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • basicBlock

        private final edu.umd.cs.findbugs.ba.BasicBlock basicBlock
      • uncheckedFields

        private java.util.Set<java.lang.String> uncheckedFields
      • fieldsAreSharedWithParent

        private boolean fieldsAreSharedWithParent
    • Constructor Detail

      • BlockState

        public BlockState​(edu.umd.cs.findbugs.ba.BasicBlock bb,
                          java.util.Set<java.lang.String> fields)
        creates a BlockState consisting of the next basic block to parse, and what fields are to be checked
        Parameters:
        bb - the basic block to parse
        fields - the fields to look for first use
      • BlockState

        public BlockState​(edu.umd.cs.findbugs.ba.BasicBlock bb,
                          FieldCouldBeLocal.BlockState parentBlockState)
        creates a BlockState consisting of the next basic block to parse, and what fields are to be checked
        Parameters:
        bb - the basic block to parse
        parentBlockState - the basic block to copy from
    • Method Detail

      • getBasicBlock

        public edu.umd.cs.findbugs.ba.BasicBlock getBasicBlock()
        get the basic block to parse
        Returns:
        the basic block
      • getUncheckedFieldSize

        public int getUncheckedFieldSize()
        returns the number of unchecked fields
        Returns:
        the number of unchecked fields
      • removeUncheckedField

        public boolean removeUncheckedField​(java.lang.String field)
        return the field from the set of unchecked fields if this occurs make a copy of the set on write to reduce memory usage
        Parameters:
        field - the field to be removed
        Returns:
        whether the object was removed.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object