aspect CJPCompatibility { inh TypeDecl Expr.getShadowExpectedReturnType(); eq AssignSimpleExpr.getSource().getShadowExpectedReturnType() = getDest().type(); eq ReturnStmt.getResult().getShadowExpectedReturnType() = returnType(); eq VariableDeclaration.getInit().getShadowExpectedReturnType() = type(); eq Program.getChild().getShadowExpectedReturnType() = typeVoid(); inh lazy List Expr.getShadowExpectedExceptionList(); eq MethodDecl.getBlock().getShadowExpectedExceptionList() = getExceptions(); eq Program.getChild().getShadowExpectedExceptionList() = null; //rewrite CJP's JoinpointTypeDecl to JPITypeDecl rewrite JoinpointTypeDecl { when(!isJPITypeDecl()) to JPITypeDecl { return new JPITypeDecl(getModifiers(), getID(), getBodyDecls(), getTypeAccess(), getParameters(), getExceptions(), new DummyAccess("","$RootJPI$"),new List()); } } refine TypeCheckCJP public void ClosureJoinpointAccess.correctTheReturnTypeAndThrowsList(){ TypeDecl decl = getName().type(); TypeDecl returnShadowType = this.getShadowExpectedReturnType(); TypeAccess cjpReturnTypeAccess = null; List cjpExceptionList = new List(); boolean exceptionTypeVariableFlag = false; if (decl.isJoinpointTypeDecl()) { JoinpointTypeDecl joinpointTypeDecl = (JoinpointTypeDecl) decl; cjpReturnTypeAccess = (TypeAccess)joinpointTypeDecl.getTypeAccess(); if (cjpReturnTypeAccess.type().isTypeVariable()) { try { cjpReturnTypeAccess = cjpReturnTypeAccess.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); //cannot occur } cjpReturnTypeAccess.decl_value = returnShadowType; cjpReturnTypeAccess.decls_value = returnShadowType; cjpReturnTypeAccess.tokenString_ID = returnShadowType.tokenString_ID; cjpReturnTypeAccess.decl_computed = true; cjpReturnTypeAccess.parent = this; } try{ for(Access exception : joinpointTypeDecl.getExceptionList()) { if (exception.type().isTypeVariable()) { exceptionTypeVariableFlag = true; } else { cjpExceptionList.add(exception.clone()); } } if (exceptionTypeVariableFlag) { for(int i=0; i