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

changeset 1473
31780dd06ec7
parent 1464
f72c9c5aeaef
child 1521
71f35e4b93a5
equal deleted inserted replaced
1472:0c244701188e 1473:31780dd06ec7
723 } 723 }
724 acount += writeJavaAnnotations(sym.getRawAttributes()); 724 acount += writeJavaAnnotations(sym.getRawAttributes());
725 return acount; 725 return acount;
726 } 726 }
727 727
728 /**
729 * Write method parameter names attribute.
730 */
731 int writeMethodParametersAttr(MethodSymbol m) {
732 if (m.params != null && 0 != m.params.length()) {
733 int attrIndex = writeAttr(names.MethodParameters);
734 databuf.appendByte(m.params.length());
735 for (VarSymbol s : m.params) {
736 // TODO: expand to cover synthesized, once we figure out
737 // how to represent that.
738 final int flags = (int) s.flags() & (FINAL | SYNTHETIC);
739 // output parameter info
740 databuf.appendChar(pool.put(s.name));
741 databuf.appendInt(flags);
742 }
743 endAttr(attrIndex);
744 return 1;
745 } else
746 return 0;
747 }
748
749
728 /** Write method parameter annotations; 750 /** Write method parameter annotations;
729 * return number of attributes written. 751 * return number of attributes written.
730 */ 752 */
731 int writeParameterAttrs(MethodSymbol m) { 753 int writeParameterAttrs(MethodSymbol m) {
732 boolean hasVisible = false; 754 boolean hasVisible = false;
1032 int alenIdx = writeAttr(names.AnnotationDefault); 1054 int alenIdx = writeAttr(names.AnnotationDefault);
1033 m.defaultValue.accept(awriter); 1055 m.defaultValue.accept(awriter);
1034 endAttr(alenIdx); 1056 endAttr(alenIdx);
1035 acount++; 1057 acount++;
1036 } 1058 }
1059 if (options.isSet(PARAMETERS))
1060 acount += writeMethodParametersAttr(m);
1037 acount += writeMemberAttrs(m); 1061 acount += writeMemberAttrs(m);
1038 acount += writeParameterAttrs(m); 1062 acount += writeParameterAttrs(m);
1039 endAttrs(acountIdx, acount); 1063 endAttrs(acountIdx, acount);
1040 } 1064 }
1041 1065

mercurial