/* This file was generated by Contract AspectJ v0.1 on Sat Nov 06 14:12:10 EST 2004 */ /** CONAJ: Original packages **/ package jsim.queue; /** CONAJ: Imports needed by CONAJ **/ import org.aspectj.lang.*; import java.util.*; /** CONAJ: Original imports **/ privileged aspect PQ_Node_Contract { declare parents : PQ_Node implements Cloneable; public Object PQ_Node.clone(){ try { return super.clone(); } catch (Exception e){ System.out.println(" Error in cloning method"); e.printStackTrace(); return new Object(); } } PQ_Node old; pointcut scope(): !within(PQ_Node_Contract) && !cflow(withincode(* PQ_Node_Contract.*(..))); pointcut PQ_Node_compare1(PQ_Node trg_instance, PQ_Node that):call( public * PQ_Node.compare(..)) && !call(public * (PQ_Node+ && !PQ_Node).compare(..)) && args(that) && target(trg_instance) && scope(); pointcut cast_PQ_Node_compare1(PQ_Node trg_instance, PQ_Node that):!(call( public * PQ_Node.compare(..))) && execution(public * PQ_Node.compare(..)) && !execution( public * (PQ_Node+ && !PQ_Node).compare(..)) && args(that) && target(trg_instance) && scope(); before(PQ_Node trg_instance , PQ_Node that ): PQ_Node_compare1( trg_instance , that ){ boolean res = checkPre_compare( trg_instance , that); boolean next = true ; if (!res){ System.out.println(" *** PRE CONDITION ERROR in PQ_Node in Method: compare"); System.exit(1); }if (!next) { System.out.println(" *** PRE HIER ERROR in PQ_Node in Method: compare"); System.exit(1); } } before(PQ_Node trg_instance , PQ_Node that ): cast_PQ_Node_compare1( trg_instance, that ){ String staticType = thisJoinPoint.getSignature().getDeclaringType().getName(); String dynamicType = thisJoinPoint.getTarget().getClass().getName(); boolean hierResult = (true); boolean res = checkPre_compare( trg_instance , that); if (hierResult && ! res){ System.out.println(" **** CAST PRE HIER ERROR PQ_Node in Method: compare"); System.out.println("[conaj-ERROR]: ***** staticType "+staticType+" **** dynamicType "+dynamicType+" SIG ==> "+ thisJoinPoint.getSignature().toLongString());System.exit(1); } } public boolean checkPre_compare(PQ_Node trg_instance,PQ_Node that){ if(that!=null) return true; else return false; } public boolean checkPreHier_compare(PQ_Node trg_instance,PQ_Node that){ boolean myPre = checkPre_compare( trg_instance , that); boolean hierarchy = (true); if (!hierarchy || myPre) return myPre; else return false; } }