src/share/classes/com/sun/tools/javac/comp/Lower.java

Print this page




2694             if (tree.body == null) {
2695                 result = tree;
2696                 return;
2697             }
2698 
2699             // Add this$n (if needed) in front of and free variables behind
2700             // constructor parameter list.
2701             tree.params = tree.params.appendList(fvdefs);
2702             if (currentClass.hasOuterInstance())
2703                 tree.params = tree.params.prepend(otdef);
2704 
2705             // If this is an initial constructor, i.e., it does not start with
2706             // this(...), insert initializers for this$n and proxies
2707             // before (pre-1.4, after) the call to superclass constructor.
2708             JCStatement selfCall = translate(tree.body.stats.head);
2709 
2710             List<JCStatement> added = List.nil();
2711             if (fvs.nonEmpty()) {
2712                 List<Type> addedargtypes = List.nil();
2713                 for (List<VarSymbol> l = fvs; l.nonEmpty(); l = l.tail) {
2714                     if (TreeInfo.isInitialConstructor(tree))


2715                         added = added.prepend(
2716                             initField(tree.body.pos, proxyName(l.head.name)));

2717                     addedargtypes = addedargtypes.prepend(l.head.erasure(types));
2718                 }
2719                 Type olderasure = m.erasure(types);
2720                 m.erasure_field = new MethodType(
2721                     olderasure.getParameterTypes().appendList(addedargtypes),
2722                     olderasure.getReturnType(),
2723                     olderasure.getThrownTypes(),
2724                     syms.methodClass);
2725             }
2726             if (currentClass.hasOuterInstance() &&
2727                 TreeInfo.isInitialConstructor(tree))
2728             {
2729                 added = added.prepend(initOuterThis(tree.body.pos));
2730             }
2731 
2732             // pop local variables from proxy stack
2733             proxies = proxies.leave();
2734 
2735             // recursively translate following local statements and
2736             // combine with this- or super-call




2694             if (tree.body == null) {
2695                 result = tree;
2696                 return;
2697             }
2698 
2699             // Add this$n (if needed) in front of and free variables behind
2700             // constructor parameter list.
2701             tree.params = tree.params.appendList(fvdefs);
2702             if (currentClass.hasOuterInstance())
2703                 tree.params = tree.params.prepend(otdef);
2704 
2705             // If this is an initial constructor, i.e., it does not start with
2706             // this(...), insert initializers for this$n and proxies
2707             // before (pre-1.4, after) the call to superclass constructor.
2708             JCStatement selfCall = translate(tree.body.stats.head);
2709 
2710             List<JCStatement> added = List.nil();
2711             if (fvs.nonEmpty()) {
2712                 List<Type> addedargtypes = List.nil();
2713                 for (List<VarSymbol> l = fvs; l.nonEmpty(); l = l.tail) {
2714                     if (TreeInfo.isInitialConstructor(tree)) {
2715                         m.extraParams =
2716                             m.extraParams.append((VarSymbol)(proxies.lookup(proxyName(l.head.name)).sym));
2717                         added = added.prepend(
2718                           initField(tree.body.pos, proxyName(l.head.name)));
2719                     }
2720                     addedargtypes = addedargtypes.prepend(l.head.erasure(types));
2721                 }
2722                 Type olderasure = m.erasure(types);
2723                 m.erasure_field = new MethodType(
2724                     olderasure.getParameterTypes().appendList(addedargtypes),
2725                     olderasure.getReturnType(),
2726                     olderasure.getThrownTypes(),
2727                     syms.methodClass);
2728             }
2729             if (currentClass.hasOuterInstance() &&
2730                 TreeInfo.isInitialConstructor(tree))
2731             {
2732                 added = added.prepend(initOuterThis(tree.body.pos));
2733             }
2734 
2735             // pop local variables from proxy stack
2736             proxies = proxies.leave();
2737 
2738             // recursively translate following local statements and
2739             // combine with this- or super-call