polyglot.visit
Class InitChecker.ClassBodyInfo

java.lang.Object
  extended by polyglot.visit.InitChecker.ClassBodyInfo
Enclosing class:
InitChecker

protected static class InitChecker.ClassBodyInfo
extends java.lang.Object

This class is just a data structure containing relevant information needed for performing initialization checking of a class declaration. These objects form a stack, since class declarations can be nested.


Field Summary
 java.util.List allConstructors
          List of all the constructors.
 java.util.Map constructorCalls
          Map from ConstructorInstances to ConstructorInstances detailing which constructors call which constructors.
 ClassType currClass
          The current class being processed.
 java.util.Map currClassFinalFieldInitCounts
          A Map of all the final fields in the class currently being processed to MinMaxInitCounts.
 CodeNode currCodeDecl
          The current CodeNode being processed by the dataflow equations
 java.util.Map fieldsConstructorInitializes
          Map from ConstructorInstances to Sets of FieldInstances, detailing which final non-static fields each constructor initializes.
 java.util.Set localDeclarations
          Set of LocalInstances that we have seen declarations for in this class.
 java.util.Map localsUsedInClassBodies
          Map from ClassBodys to Sets of LocalInstances.
 InitChecker.ClassBodyInfo outer
          The info for the outer ClassBody.
 java.util.Set outerLocalsUsed
          Set of LocalInstances from the outer class body that were used during the declaration of this class.
 
Constructor Summary
protected InitChecker.ClassBodyInfo()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outer

public InitChecker.ClassBodyInfo outer
The info for the outer ClassBody. The ClassBodyInfos form a stack.


currCodeDecl

public CodeNode currCodeDecl
The current CodeNode being processed by the dataflow equations


currClass

public ClassType currClass
The current class being processed.


currClassFinalFieldInitCounts

public java.util.Map currClassFinalFieldInitCounts
A Map of all the final fields in the class currently being processed to MinMaxInitCounts. This Map is used as the basis for the Maps returned in createInitialItem().


allConstructors

public java.util.List allConstructors
List of all the constructors. These will be checked once all the initializer blocks have been processed.


constructorCalls

public java.util.Map constructorCalls
Map from ConstructorInstances to ConstructorInstances detailing which constructors call which constructors. This is used in checking the initialization of final fields.


fieldsConstructorInitializes

public java.util.Map fieldsConstructorInitializes
Map from ConstructorInstances to Sets of FieldInstances, detailing which final non-static fields each constructor initializes. This is used in checking the initialization of final fields.


outerLocalsUsed

public java.util.Set outerLocalsUsed
Set of LocalInstances from the outer class body that were used during the declaration of this class. We need to track this in order to correctly populate localsUsedInClassBodies


localsUsedInClassBodies

public java.util.Map localsUsedInClassBodies
Map from ClassBodys to Sets of LocalInstances. If localsUsedInClassBodies(C) = S, then the class body C is an inner class declared in the current code declaration, and S is the set of LocalInstances that are defined in the current code declaration, but are used in the declaration of the class C. We need this information in order to ensure that these local variables are definitely assigned before the class declaration of C.


localDeclarations

public java.util.Set localDeclarations
Set of LocalInstances that we have seen declarations for in this class. This set allows us to determine which local instances are simply being used before they are declared (if they are used in their own initialization) or are locals declared in an enclosing class.

Constructor Detail

InitChecker.ClassBodyInfo

protected InitChecker.ClassBodyInfo()