--- old/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java 2014-12-09 15:41:12.633867903 -0500 +++ new/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java 2014-12-09 15:41:12.551866879 -0500 @@ -670,27 +670,6 @@ } - private void writeParamAnnotations(List params, - RetentionPolicy retention) { - for (VarSymbol s : params) { - ListBuffer buf = new ListBuffer<>(); - for (Attribute.Compound a : s.getRawAttributes()) - if (types.getRetention(a) == retention) - buf.append(a); - databuf.appendChar(buf.length()); - for (Attribute.Compound a : buf) - writeCompoundAttribute(a); - } - - } - - private void writeParamAnnotations(MethodSymbol m, - RetentionPolicy retention) { - databuf.appendByte(m.params.length() + m.extraParams.length()); - writeParamAnnotations(m.extraParams, retention); - writeParamAnnotations(m.params, retention); - } - /** Write method parameter annotations; * return number of attributes written. */ @@ -713,13 +692,31 @@ int attrCount = 0; if (hasVisible) { int attrIndex = writeAttr(names.RuntimeVisibleParameterAnnotations); - writeParamAnnotations(m, RetentionPolicy.RUNTIME); + databuf.appendByte(m.params.length()); + for (VarSymbol s : m.params) { + ListBuffer buf = new ListBuffer(); + for (Attribute.Compound a : s.getRawAttributes()) + if (types.getRetention(a) == RetentionPolicy.RUNTIME) + buf.append(a); + databuf.appendChar(buf.length()); + for (Attribute.Compound a : buf) + writeCompoundAttribute(a); + } endAttr(attrIndex); attrCount++; } if (hasInvisible) { int attrIndex = writeAttr(names.RuntimeInvisibleParameterAnnotations); - writeParamAnnotations(m, RetentionPolicy.CLASS); + databuf.appendByte(m.params.length()); + for (VarSymbol s : m.params) { + ListBuffer buf = new ListBuffer(); + for (Attribute.Compound a : s.getRawAttributes()) + if (types.getRetention(a) == RetentionPolicy.CLASS) + buf.append(a); + databuf.appendChar(buf.length()); + for (Attribute.Compound a : buf) + writeCompoundAttribute(a); + } endAttr(attrIndex); attrCount++; }