|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--edu.ucsb.ccs.jcontractor.transformation.Transformation
|
+--edu.ucsb.ccs.jcontractor.transformation.ContractTransformation
|
+--edu.ucsb.ccs.jcontractor.transformation.LockCloneTransformation
Transformation to disable contract checking while in the
clone() method. clone() is used to
implement OLD references, and checking contracts on method called
from clone() could require more calls to
clone(). This leads to infinite recursion, which
would be bad. To prevent this scenario, jContractor does not check
contracts on any methods called from clone().
Note: Strictly speaking, all that is required is to not check contracts that refer to OLD. However, just supressing all contract checks is much easier to implement.
| Constructor Summary | |
LockCloneTransformation()
|
|
| Method Summary | |
boolean |
acceptClass()
Determine if the current class should be processed. |
void |
transformClass()
Does nothing. |
void |
transformMethod(org.apache.bcel.generic.MethodGen mg)
Add code to a clone() method that will suppress
contract checks inside the method. |
| Methods inherited from class edu.ucsb.ccs.jcontractor.transformation.Transformation |
getTransformer, setTransformer, transform |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LockCloneTransformation()
| Method Detail |
public boolean acceptClass()
acceptClass in class Transformationpublic void transformMethod(org.apache.bcel.generic.MethodGen mg)
clone() method that will suppress
contract checks inside the method. Has no effect if the method
is not named "clone", with no arguments, and a Object return
type.
transformMethod in class Transformationmg - a method to transform. The method is transformed only
if it is a has the signature "Object clone()".public void transformClass()
transformClass in class Transformation
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||