Package com.mebigfatguy.fbcontrib.detect
Class FieldCouldBeLocal.BlockState
- java.lang.Object
-
- com.mebigfatguy.fbcontrib.detect.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.
-
-
Field Summary
Fields Modifier and Type Field Description private edu.umd.cs.findbugs.ba.BasicBlock
basicBlock
private boolean
fieldsAreSharedWithParent
private java.util.Set<java.lang.String>
uncheckedFields
-
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 checkedBlockState(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 parseint
getUncheckedFieldSize()
returns the number of unchecked fieldsboolean
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 usagejava.lang.String
toString()
-
-
-
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 parsefields
- 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 parseparentBlockState
- 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 classjava.lang.Object
-
-