< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java

Print this page

1626                     beforeConstructor = beforeConstructor.prepend(defs.head);
1627                     defs = defs.tail;
1628                 }
1629                 if (defs.nonEmpty() &&
1630                     (((JCMethodDecl) defs.head).mods.flags & Flags.GENERATEDCONSTR) != 0) {
1631                     defs = defs.tail;
1632                     while (beforeConstructor.nonEmpty()) {
1633                         defs = defs.prepend(beforeConstructor.head);
1634                         beforeConstructor = beforeConstructor.tail;
1635                     }
1636                     node.defs = defs;
1637                 }
1638                 if (node.sym != null) {
1639                     node.sym.completer = new ImplicitCompleter(topLevel);
1640                     List<? extends RecordComponent> recordComponents = node.sym.getRecordComponents();
1641                     for (RecordComponent rc : recordComponents) {
1642                         List<JCAnnotation> originalAnnos = rc.getOriginalAnnos();
1643                         originalAnnos.forEach(a -> visitAnnotation(a));
1644                     }
1645                     // we should empty the list of permitted subclasses for next round
1646                     node.sym.permitted = List.nil();
1647                 }
1648                 node.sym = null;
1649             }
1650             public void visitMethodDef(JCMethodDecl node) {
1651                 // remove super constructor call that may have been added during attribution:
1652                 if (TreeInfo.isConstructor(node) && node.sym != null && node.sym.owner.isEnum() &&
1653                     node.body != null && node.body.stats.nonEmpty() && TreeInfo.isSuperCall(node.body.stats.head) &&
1654                     node.body.stats.head.pos == node.body.pos) {
1655                     node.body.stats = node.body.stats.tail;
1656                 }
1657                 node.sym = null;
1658                 super.visitMethodDef(node);
1659             }
1660             public void visitVarDef(JCVariableDecl node) {
1661                 node.sym = null;
1662                 super.visitVarDef(node);
1663             }
1664             public void visitNewClass(JCNewClass node) {
1665                 node.constructor = null;
1666                 super.visitNewClass(node);

1626                     beforeConstructor = beforeConstructor.prepend(defs.head);
1627                     defs = defs.tail;
1628                 }
1629                 if (defs.nonEmpty() &&
1630                     (((JCMethodDecl) defs.head).mods.flags & Flags.GENERATEDCONSTR) != 0) {
1631                     defs = defs.tail;
1632                     while (beforeConstructor.nonEmpty()) {
1633                         defs = defs.prepend(beforeConstructor.head);
1634                         beforeConstructor = beforeConstructor.tail;
1635                     }
1636                     node.defs = defs;
1637                 }
1638                 if (node.sym != null) {
1639                     node.sym.completer = new ImplicitCompleter(topLevel);
1640                     List<? extends RecordComponent> recordComponents = node.sym.getRecordComponents();
1641                     for (RecordComponent rc : recordComponents) {
1642                         List<JCAnnotation> originalAnnos = rc.getOriginalAnnos();
1643                         originalAnnos.forEach(a -> visitAnnotation(a));
1644                     }
1645                     // we should empty the list of permitted subclasses for next round
1646                     node.sym.clearPermittedSubclasses();
1647                 }
1648                 node.sym = null;
1649             }
1650             public void visitMethodDef(JCMethodDecl node) {
1651                 // remove super constructor call that may have been added during attribution:
1652                 if (TreeInfo.isConstructor(node) && node.sym != null && node.sym.owner.isEnum() &&
1653                     node.body != null && node.body.stats.nonEmpty() && TreeInfo.isSuperCall(node.body.stats.head) &&
1654                     node.body.stats.head.pos == node.body.pos) {
1655                     node.body.stats = node.body.stats.tail;
1656                 }
1657                 node.sym = null;
1658                 super.visitMethodDef(node);
1659             }
1660             public void visitVarDef(JCVariableDecl node) {
1661                 node.sym = null;
1662                 super.visitVarDef(node);
1663             }
1664             public void visitNewClass(JCNewClass node) {
1665                 node.constructor = null;
1666                 super.visitNewClass(node);
< prev index next >