Package com.mebigfatguy.fbcontrib.detect
Class FieldCouldBeLocal.BlockState
java.lang.Object
com.mebigfatguy.fbcontrib.detect.FieldCouldBeLocal.BlockState
- Enclosing class:
FieldCouldBeLocal
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
FieldsModifier and TypeFieldDescriptionprivate final edu.umd.cs.findbugs.ba.BasicBlockprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionBlockState(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, Set<String> fields) creates a BlockState consisting of the next basic block to parse, and what fields are to be checked -
Method Summary
Modifier and TypeMethodDescriptionedu.umd.cs.findbugs.ba.BasicBlockget the basic block to parseintreturns the number of unchecked fieldsbooleanremoveUncheckedField(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 usagetoString()
-
Field Details
-
basicBlock
private final edu.umd.cs.findbugs.ba.BasicBlock basicBlock -
uncheckedFields
-
-
Constructor Details
-
BlockState
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 Details
-
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
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
-