[Nice-commit] Nice/src/gnu/expr ClassExp.java,1.20,1.21 CheckContract.java,1.3,1.4
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-07-22 16:15:05
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6072/src/gnu/expr Modified Files: ClassExp.java CheckContract.java Log Message: Fix importing of class methods with contracts. Index: ClassExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ClassExp.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ClassExp.java 17 Jun 2004 11:48:17 -0000 1.20 --- ClassExp.java 22 Jul 2004 16:14:54 -0000 1.21 *************** *** 61,64 **** --- 61,65 ---- this(); this.type = this.instanceType = type; + setName(type.getName()); } *************** *** 681,686 **** if (assertionEnabledField == null) { ! assertionEnabledField = ((ClassType) getType()).addField ! ("$assertionsEnabled", Type.boolean_type, Access.STATIC | Access.FINAL); --- 682,695 ---- if (assertionEnabledField == null) { ! ClassType classe = (ClassType) getType(); ! ! // Get the field if it already exists. ! // This is the case for already compiled classes. ! assertionEnabledField = classe.getField("$assertionsEnabled"); ! if (assertionEnabledField != null) ! return assertionEnabledField; ! ! assertionEnabledField = classe.addField ! ("$assertionsEnabled", Type.boolean_type, Access.STATIC | Access.FINAL); Index: CheckContract.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/CheckContract.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CheckContract.java 19 Mar 2003 00:45:16 -0000 1.3 --- CheckContract.java 22 Jul 2004 16:14:54 -0000 1.4 *************** *** 40,46 **** { CodeAttr code = comp.getCode(); ! ClassExp currentClass = (ClassExp)comp.topLambda; code.preparePostcondition(currentClass.getAssertionEnabledField(), post.length>0); ! if (pre.length > 0) { code.startPrecondition(); --- 40,46 ---- { CodeAttr code = comp.getCode(); ! ClassExp currentClass = comp.curLambda.outerClass(); code.preparePostcondition(currentClass.getAssertionEnabledField(), post.length>0); ! if (pre.length > 0) { code.startPrecondition(); *************** *** 58,66 **** for (int i = 0; i < post.length; i++) post[i].compileWithPosition(comp, Target.Ignore); ! code.endPostcondition(); } else ! code.pushRetType(); } --- 58,66 ---- for (int i = 0; i < post.length; i++) post[i].compileWithPosition(comp, Target.Ignore); ! code.endPostcondition(); } else ! code.pushRetType(); } |