jif.extension

## Class JifConstructorDeclExt

- java.lang.Object
- - polyglot.ast.Ext_c
  - - jif.ast.JifExt_c
    - - jif.extension.JifProcedureDeclExt_c
      - - jif.extension.JifConstructorDeclExt

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, JifExt, JifProcedureDeclExt, polyglot.ast.Ext, polyglot.ast.NodeOps, polyglot.util.Copy<polyglot.ast.Ext>

      public class JifConstructorDeclExt
      extends JifProcedureDeclExt_c

  The Jif extension of the `JifConstructorDecl` node.
  See Also:
    `ConstructorDecl`, `JifConstructorDecl`, Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class jif.extension.JifProcedureDeclExt_c

      `JifProcedureDeclExt_c.ConstraintVarianceLabelChecker`

    - ### Nested classes/interfaces inherited from interface polyglot.util.Copy

      `polyglot.util.Copy.Util`

  - ### Field Summary

    - ### Fields inherited from class jif.extension.JifProcedureDeclExt_c

      `jif_verbose`

    - ### Fields inherited from class jif.ast.JifExt_c

      `toJava, X`

    - ### Fields inherited from class polyglot.ast.Ext_c

      `ext, node, pred`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JifConstructorDeclExt(ToJavaExt toJava)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkFinalFieldAssignment(polyglot.ast.Stmt s_, java.util.Set<JifFieldInstance> uninitFinalVars, JifContext A)` Check if the stmt is an assignment to a final field.
    `protected polyglot.ast.Block` | `checkInitsAndBody(Label Li, JifConstructorInstance ci, polyglot.ast.Block body, LabelChecker lc)` This method implements the check-inits predicate of the thesis (Figures 4.41-45).
    `polyglot.ast.Node` | `labelCheck(LabelChecker lc)` Label check the node to which this extension is attached.
    `protected void` | `setEndOfInitChecking(LabelChecker lc, JifConstructorInstance ci)`
    `protected static java.util.Set<JifFieldInstance>` | `uninitFinalFields(polyglot.types.ReferenceType type)` Utility method to get the set of field instances of final fields of the given `ReferenceType` that do not have an initializer.
    `protected void` | `updateContextForNextStmt(LabelChecker lc, JifContext A, PathMap Xprev)` Utility method for updating the context for checking the next statement in the block.

    - ### Methods inherited from class jif.extension.JifProcedureDeclExt_c

      `addCallers, addReturnConstraints, checkActsForAuthority, checkAutoEndorseConstrainPC, checkConstraintVariance, checkEnforceSignature, checkFormals, checkProviderAuthority, constrainAuth, constrainLabelEnv`

    - ### Methods inherited from class jif.ast.JifExt_c

      `checkAndRemoveThrowType, checkThrowTypes, copy, dump, getPathMap, init, integerBoundsCalculated, toJava, toJava, updatePathMap, X, X`

    - ### Methods inherited from class polyglot.ast.Ext_c

      `addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, ext, ext, extRewrite, extRewriteEnter, extRewriteOverride, initPred, lang, node, pred, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, superLang, throwTypes, toString, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitList`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface jif.ast.JifExt

      `integerBoundsCalculated, toJava, toJava, X, X`

    - ### Methods inherited from interface polyglot.ast.Ext

      `dump, ext, ext, init, initPred, node, pred`

    - ### Methods inherited from interface polyglot.ast.NodeOps

      `addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, extRewriteOverride, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitList`

    - ### Methods inherited from interface polyglot.util.Copy

      `copy`

- - ### Constructor Detail

    - #### JifConstructorDeclExt

          public JifConstructorDeclExt(ToJavaExt toJava)

  - ### Method Detail

    - #### labelCheck

          public polyglot.ast.Node labelCheck(LabelChecker lc)
                                       throws polyglot.types.SemanticException

      Description copied from interface: `JifExt`
      Label check the node to which this extension is attached.
      Specified by:
        `labelCheck` in interface `JifExt`
      Overrides:
        `labelCheck` in class `JifExt_c`
      Throws:
        `polyglot.types.SemanticException`

    - #### uninitFinalFields

          protected static java.util.Set<JifFieldInstance> uninitFinalFields(polyglot.types.ReferenceType type)

      Utility method to get the set of field instances of final fields of the given `ReferenceType` that do not have an initializer.

    - #### checkInitsAndBody

          protected polyglot.ast.Block checkInitsAndBody(Label Li,
                                                         JifConstructorInstance ci,
                                                         polyglot.ast.Block body,
                                                         LabelChecker lc)
                                                  throws polyglot.types.SemanticException

      This method implements the check-inits predicate of the thesis (Figures 4.41-45).
      Throws:
        `polyglot.types.SemanticException`

    - #### updateContextForNextStmt

          protected void updateContextForNextStmt(LabelChecker lc,
                                                  JifContext A,
                                                  PathMap Xprev)

      Utility method for updating the context for checking the next statement in the block. Useful for overriding in projects like fabric.

    - #### setEndOfInitChecking

          protected void setEndOfInitChecking(LabelChecker lc,
                                              JifConstructorInstance ci)

    - #### checkFinalFieldAssignment

          protected void checkFinalFieldAssignment(polyglot.ast.Stmt s_,
                                                   java.util.Set<JifFieldInstance> uninitFinalVars,
                                                   JifContext A)
                                            throws polyglot.types.SemanticException

      Check if the stmt is an assignment to a final field. Moreover, if the final field is a label, and it is being initialized from a final label, share the uids of the fields.
      Throws:
        `polyglot.types.SemanticException`