src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java

changeset 1473
31780dd06ec7
parent 1464
f72c9c5aeaef
child 1521
71f35e4b93a5
     1.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Fri Dec 28 22:25:21 2012 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Sat Dec 29 17:33:17 2012 -0800
     1.3 @@ -725,6 +725,28 @@
     1.4          return acount;
     1.5      }
     1.6  
     1.7 +    /**
     1.8 +     * Write method parameter names attribute.
     1.9 +     */
    1.10 +    int writeMethodParametersAttr(MethodSymbol m) {
    1.11 +        if (m.params != null && 0 != m.params.length()) {
    1.12 +            int attrIndex = writeAttr(names.MethodParameters);
    1.13 +            databuf.appendByte(m.params.length());
    1.14 +            for (VarSymbol s : m.params) {
    1.15 +                // TODO: expand to cover synthesized, once we figure out
    1.16 +                // how to represent that.
    1.17 +                final int flags = (int) s.flags() & (FINAL | SYNTHETIC);
    1.18 +                // output parameter info
    1.19 +                databuf.appendChar(pool.put(s.name));
    1.20 +                databuf.appendInt(flags);
    1.21 +            }
    1.22 +            endAttr(attrIndex);
    1.23 +            return 1;
    1.24 +        } else
    1.25 +            return 0;
    1.26 +    }
    1.27 +
    1.28 +
    1.29      /** Write method parameter annotations;
    1.30       *  return number of attributes written.
    1.31       */
    1.32 @@ -1034,6 +1056,8 @@
    1.33              endAttr(alenIdx);
    1.34              acount++;
    1.35          }
    1.36 +        if (options.isSet(PARAMETERS))
    1.37 +            acount += writeMethodParametersAttr(m);
    1.38          acount += writeMemberAttrs(m);
    1.39          acount += writeParameterAttrs(m);
    1.40          endAttrs(acountIdx, acount);

mercurial