[Nice-commit] Nice/src/gnu/expr ClassExp.java,1.18,1.19
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-06-11 15:53:44
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28516/src/gnu/expr Modified Files: ClassExp.java Log Message: Is is now possible to make a class of an imported package implement an interface defined in the current package (fixes #904327). Index: ClassExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ClassExp.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ClassExp.java 14 Apr 2004 16:35:35 -0000 1.18 --- ClassExp.java 11 Jun 2004 15:53:35 -0000 1.19 *************** *** 213,216 **** --- 213,221 ---- } + public void recomputeInterfaces() + { + setTypes(); + } + private void setTypes() { *************** *** 234,266 **** superTypes[j++] = t; } ! if (superType == null) ! { ! if (! isSimple()) ! { ! PairClassType ptype = new PairClassType(); ! type = ptype; ! setMakingClassPair(true); ! instanceType = new ClassType(); ! type.setInterface(true); ! ClassType[] interfaces = { type }; ! // Can we better. FIXME. ! instanceType.setSuper(Type.pointer_type); ! instanceType.setInterfaces(interfaces); ! ptype.instanceType = instanceType; ! } ! else ! instanceType = type = new ClassType(getName()); ! type.setSuper(Type.pointer_type); ! } ! else { ! instanceType = type = new ClassType(getName()); ! type.setSuper(superType); } - instanceType.collectable = true; - // Access.SUPER mut be set on all non-interface classes - if (! isInterface()) - accessFlags |= Access.SUPER; - instanceType.setModifiers(accessFlags); if (j > 0) --- 239,278 ---- superTypes[j++] = t; } ! ! // If type is null, we simply want to recompute interfaces ! if (type == null) { ! if (superType == null) ! { ! if (! isSimple()) ! { ! PairClassType ptype = new PairClassType(); ! type = ptype; ! setMakingClassPair(true); ! instanceType = new ClassType(); ! type.setInterface(true); ! ClassType[] interfaces = { type }; ! // Can we better. FIXME. ! instanceType.setSuper(Type.pointer_type); ! instanceType.setInterfaces(interfaces); ! ptype.instanceType = instanceType; ! } ! else ! instanceType = type = new ClassType(getName()); ! type.setSuper(Type.pointer_type); ! } ! else ! { ! System.out.println(getName()); ! instanceType = type = new ClassType(getName()); ! type.setSuper(superType); ! } ! ! instanceType.collectable = true; ! // Access.SUPER mut be set on all non-interface classes ! if (! isInterface()) ! accessFlags |= Access.SUPER; ! instanceType.setModifiers(accessFlags); } if (j > 0) |