src/share/classes/com/sun/tools/javac/util/List.java

changeset 1362
c46e0c9940d6
parent 1347
1408af4cd8b0
child 1442
fcf89720ae71
equal deleted inserted replaced
1361:6517bf8e50d0 1362:c46e0c9940d6
1 /* 1 /*
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
285 */ 285 */
286 public String toString(String sep) { 286 public String toString(String sep) {
287 if (isEmpty()) { 287 if (isEmpty()) {
288 return ""; 288 return "";
289 } else { 289 } else {
290 StringBuffer buf = new StringBuffer(); 290 StringBuilder buf = new StringBuilder();
291 buf.append(head); 291 buf.append(head);
292 for (List<A> l = tail; l.nonEmpty(); l = l.tail) { 292 for (List<A> l = tail; l.nonEmpty(); l = l.tail) {
293 buf.append(sep); 293 buf.append(sep);
294 buf.append(l.head); 294 buf.append(l.head);
295 } 295 }

mercurial