Type[] newParents; if (newParentsLst.size() == oldParents.length) newParents = oldParents; else newParents = (Type[]) newParentsLst.toArray(new Type[newParentsLst.size()]); return Type.compoundType(newParents, newMembers, sym);
    public Type transformInfo(Symbol sym, Type tp) {        if (sym.isConstructor()            && needInterface(sym.primaryConstructorClass())) {            // The symbol is a constructor of a class which needs            // an interface. All its value arguments have to be            // removed.            return removeValueParams(tp);        } else if (sym.isClass() && !sym.isPackage()) {            if (needInterface(sym)) {                // Before this phase, the symbol is a class, but after                // it will be an interface. Its type has to be changed                // so that:                //                //   1. Java classes are removed from its parents,                //                //   2. only members which will end up in the                //      interface are kept, and private ones are made                //      public and renamed.                sym.flags |= Modifiers.INTERFACE;                Scope.SymbolIterator oldMembersIt =                    new Scope.UnloadIterator(tp.members().iterator());                Scope newMembers = new Scope();                while (oldMembersIt.hasNext()) {                    Symbol member = oldMembersIt.next();                    if (!memberGoesInInterface(member))                        continue;                    if (member.isPrivate()) {                        member.name = uniqueName(member);                        member.flags ^= Modifiers.PRIVATE;                    } else if (member.isProtected())                        member.flags ^= Modifiers.PROTECTED;                    newMembers.enterOrOverload(member);                }                LinkedList/*<Type>*/ newParentsLst = new LinkedList();                Type[] oldParents = tp.parents();                for (int i = 0; i < oldParents.length; ++i) {                    if (! oldParents[i].symbol().isJava())                        newParentsLst.addLast(oldParents[i]);                }                Type[] newParents;                if (newParentsLst.size() == oldParents.length)                    newParents = oldParents;                else                    newParents = (Type[])                        newParentsLst.toArray(new Type[newParentsLst.size()]);                return Type.compoundType(newParents, newMembers, sym);            } else {                // The symbol is the one of a class which doesn't need                // an interface. We need to fix its parents to use                // class symbols instead of interface symbols.                LinkedList/*<Type>*/ newParentsLst = new LinkedList();                Type[] oldParents = tp.parents();                for (int i = 0; i < oldParents.length; ++i) {                    switch (oldParents[i]) {                    case TypeRef(Type pre, Symbol oldSym, Type[] args):                        if (needInterface(oldSym)) {                            newParentsLst.addLast(                                Type.typeRef(                                    pre, getClassSymbol(oldSym), args));                        }                        else                            newParentsLst.addLast(oldParents[i]);                        break;                    default:                        throw Debug.abort("illegal case", oldParents[i]);                    }                }                Type[] newParents = (Type[])                    newParentsLst.toArray(new Type[newParentsLst.size()]);                return Type.compoundType(newParents, tp.members(), sym);            }        } else            return tp;    }