Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.ucsb.ccs.jcontractor.transformation
Class InvariantCheckTransformation  view InvariantCheckTransformation download InvariantCheckTransformation.java

java.lang.Object
  extended byedu.ucsb.ccs.jcontractor.transformation.Transformation
      extended byedu.ucsb.ccs.jcontractor.transformation.ContractTransformation
          extended byedu.ucsb.ccs.jcontractor.transformation.ContractCheckTransformation
              extended byedu.ucsb.ccs.jcontractor.transformation.InvariantCheckTransformation

public class InvariantCheckTransformation
extends ContractCheckTransformation

A transformation to insert code to check the invariant of each method by calling _Invariant. This transformation requires that InvariantMethodTransformation and ReplaceReturnInstructionsTransformation have already been run. The contract check is built by ContractCheckTransformation. See that class for all the gory details. In most methods, the invariant is checked at both entry and exit.

This transformation depends on:

Version:
$Id: InvariantCheckTransformation.java,v 1.7 2002/05/22 06:29:12 parkera Exp $

Field Summary
 
Fields inherited from class edu.ucsb.ccs.jcontractor.transformation.Transformation
transformer
 
Constructor Summary
InvariantCheckTransformation()
           
 
Method Summary
 void transformMethod(org.apache.bcel.generic.MethodGen mg)
          Insert code to check the invariant of a method, and throw an InvariantViolationError if it fails.
 
Methods inherited from class edu.ucsb.ccs.jcontractor.transformation.ContractCheckTransformation
acceptClass, buildContractCheck_Precondition, buildContractCheck, createPushExceptionMessage_Precondition, createPushExceptionMessage, transformClass
 
Methods inherited from class edu.ucsb.ccs.jcontractor.transformation.ContractTransformation
append, canCheckEntryInvariant, canCheckExitInvariant_Precondition, canCheckExitInvariant, canCheckPostcondition, canCheckPrecondition, canHaveInheritedContract_Precondition, canHaveInheritedContract, canHaveInvariant_Precondition, canHaveInvariant, canHavePostcondition_Precondition, canHavePostcondition, canHavePrecondition_Precondition, canHavePrecondition, canReferenceOld_Precondition, canReferenceOld, contractsCheckable_Precondition, contractsCheckable, createLoadArguments_Postcondition, createLoadArguments_Precondition, createLoadArguments, entryInvariantCheckable_Precondition, findMethod, findMethod, findMethodIndex, getContractClassName_Postcondition, getContractClassName_Postcondition, getContractClassName_Precondition, getContractClassName_Precondition, getContractClassName, getContractClassName, getInvariantMethodName_Postcondition, getInvariantMethodName_Precondition, getInvariantMethodName, getInvariantMethodSignature_Postcondition, getInvariantMethodSignature_Precondition, getInvariantMethodSignature, getPostconditionMethodName_Postcondition, getPostconditionMethodName_Precondition, getPostconditionMethodName, getPostconditionMethodSignature_Postcondition, getPostconditionMethodSignature_Precondition, getPostconditionMethodSignature, getPreconditionMethodName_Postcondition, getPreconditionMethodName_Precondition, getPreconditionMethodName, getPreconditionMethodSignature_Postcondition, getPreconditionMethodSignature_Precondition, getPreconditionMethodSignature, hasExternalContract, hasInterfaceContract, hasSuperClassContract, isContractClass_Postcondition, isContractClass_Precondition, isContractClass, isContractMethod_Postcondition, isContractMethod_Precondition, isContractMethod, isInvariantMethod_Precondition, isInvariantMethod, isPostconditionMethod_Postcondition, isPostconditionMethod, isPreconditionMethod_Precondition, isPreconditionMethod, postconditionCheckable_Precondition, preconditionCheckable_Precondition, prepend, prependToConstructor_Precondition, prependToConstructor, replaceInstruction, replaceInstruction, replaceReturnInstructions_Precondition, replaceReturnInstructions
 
Methods inherited from class edu.ucsb.ccs.jcontractor.transformation.Transformation
acceptClass_Precondition, getTransformer_Postcondition, getTransformer, setTransformer_Postcondition, setTransformer_Precondition, setTransformer, transform_Precondition, transform, transformClass_Precondition, transformMethod_Precondition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvariantCheckTransformation

public InvariantCheckTransformation()
Method Detail

transformMethod

public void transformMethod(org.apache.bcel.generic.MethodGen mg)
Insert code to check the invariant of a method, and throw an InvariantViolationError if it fails. This method assumes that an invariant method exists in this class. (InvariantMethodTransformation should have been run on the method to ensure this.)

Specified by:
transformMethod in class Transformation