diff options
author | michelou <michelou@epfl.ch> | 2005-07-19 08:57:44 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2005-07-19 08:57:44 +0000 |
commit | a6b903c19508d9cab019928ee3e6daf2b2d9f00a (patch) | |
tree | 79d0b369b1e86f09d074faf2b56b3b18ec87af6b /sources | |
parent | f750bc83b416fdfaf865b15119610d0331e02eaa (diff) | |
download | scala-a6b903c19508d9cab019928ee3e6daf2b2d9f00a.tar.gz scala-a6b903c19508d9cab019928ee3e6daf2b2d9f00a.tar.bz2 scala-a6b903c19508d9cab019928ee3e6daf2b2d9f00a.zip |
- changed code of 'toString' method.
- added file header.
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/symtab/AttributeInfo.java | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/sources/scalac/symtab/AttributeInfo.java b/sources/scalac/symtab/AttributeInfo.java index 8269cc74a6..00d7c22d5a 100644 --- a/sources/scalac/symtab/AttributeInfo.java +++ b/sources/scalac/symtab/AttributeInfo.java @@ -1,3 +1,11 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002-2005, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + package scalac.symtab; import scalac.atree.AConstant; @@ -24,16 +32,24 @@ public class AttributeInfo { } public String toString() { - StringBuffer str = new StringBuffer(); + StringBuffer str = new StringBuffer("["); for (AttributeInfo attr = this; attr != null; attr = attr.next) { - str.append('['); str.append(Debug.show(attr.constr.constructorClass())); - str.append('('); - for (int i = 0; i < attr.args.length; i++) { - if (i > 0) str.append(", "); - str.append(attr.args[i]); + str.append(Debug.show(attr.constr.constructorClass())); + int n = attr.args.length; + if (n > 0) { + str.append('('); + for (int i = 0; i < n; i++) { + if (i > 0) str.append(", "); + str.append(attr.args[i]); + } + str.append(')'); + } + if (attr.next != null) { + str.append(", "); } - str.append(")]\n"); } + str.append(']'); return str.toString(); } + } |