Symbol sym = tree.symbol(); Symbol newSym = sym.overridingSymbol(parents[0]); if (newSym != Symbol.NONE) return gen.Select(tree.pos, gen.Super(tree.pos, newSym.owner()), newSym); else return super.transform(tree);
Tree qualifier = ((Tree.Select)tree).qualifier; qualifier = gen.Super(qualifier.pos, clasz); Symbol symbol = tree.symbol().overridingSymbol(parents[0]); assert symbol != Symbol.NONE: Debug.show(tree.symbol()); return gen.Select(tree.pos, qualifier, symbol);
            public Tree transform(Tree tree) {                switch (tree) {                case New(Template template):                    assert template.parents.length == 1 : tree;                    assert template.body.length == 0 : tree;                    Tree apply = template.parents[0];                    switch (apply) {                    case Apply(Tree clasz, Tree[] args):                        args = transform(args);                        apply = gen.Apply(apply.pos, clasz, args);                        return gen.New(tree.pos, apply);                    default:                        throw Debug.abort("illegal case", tree);                    }                case Select(Super(_, _), _):                    Symbol sym = tree.symbol();                    Symbol newSym = sym.overridingSymbol(parents[0]);                    if (newSym != Symbol.NONE)                        return gen.Select(tree.pos,                                          gen.Super(tree.pos, newSym.owner()),                                          newSym);                    else                        return super.transform(tree);                default:                    return super.transform(tree);                }            }