src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java

changeset 1362
c46e0c9940d6
parent 1361
6517bf8e50d0
child 1364
8db45b13526e
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Oct 10 18:34:46 2012 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Oct 10 18:44:21 2012 -0700
     1.3 @@ -1567,7 +1567,7 @@
     1.4       * @param name File name, to which path string is.
     1.5       */
     1.6      protected String pathString(PackageDoc pd, String name) {
     1.7 -        StringBuffer buf = new StringBuffer(relativePath);
     1.8 +        StringBuilder buf = new StringBuilder(relativePath);
     1.9          buf.append(DirectoryManager.getPathToPackage(pd, name));
    1.10          return buf.toString();
    1.11      }
    1.12 @@ -2030,7 +2030,7 @@
    1.13          if (! (tagName.startsWith("@link") || tagName.equals("@see"))) {
    1.14              return "";
    1.15          }
    1.16 -        StringBuffer result = new StringBuffer();
    1.17 +        StringBuilder result = new StringBuilder();
    1.18          boolean isplaintext = tagName.toLowerCase().equals("@linkplain");
    1.19          String label = see.label();
    1.20          label = (label.length() > 0)?
    1.21 @@ -2329,7 +2329,7 @@
    1.22                      text = removeNonInlineHtmlTags(text);
    1.23                  }
    1.24                  StringTokenizer lines = new StringTokenizer(text, "\r\n", true);
    1.25 -                StringBuffer textBuff = new StringBuffer();
    1.26 +                StringBuilder textBuff = new StringBuilder();
    1.27                  while (lines.hasMoreTokens()) {
    1.28                      StringBuilder line = new StringBuilder(lines.nextToken());
    1.29                      Util.replaceTabs(configuration.sourcetab, line);
    1.30 @@ -2398,7 +2398,7 @@
    1.31          //Redirect all relative links.
    1.32          int end, begin = text.toLowerCase().indexOf("<a");
    1.33          if(begin >= 0){
    1.34 -            StringBuffer textBuff = new StringBuffer(text);
    1.35 +            StringBuilder textBuff = new StringBuilder(text);
    1.36  
    1.37              while(begin >=0){
    1.38                  if (textBuff.length() > begin + 2 && ! Character.isWhitespace(textBuff.charAt(begin+2))) {
    1.39 @@ -2688,13 +2688,13 @@
    1.40       */
    1.41      private List<String> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) {
    1.42          List<String> results = new ArrayList<String>();
    1.43 -        StringBuffer annotation;
    1.44 +        StringBuilder annotation;
    1.45          for (int i = 0; i < descList.length; i++) {
    1.46              AnnotationTypeDoc annotationDoc = descList[i].annotationType();
    1.47              if (! Util.isDocumentedAnnotation(annotationDoc)){
    1.48                  continue;
    1.49              }
    1.50 -            annotation = new StringBuffer();
    1.51 +            annotation = new StringBuilder();
    1.52              LinkInfoImpl linkInfo = new LinkInfoImpl(
    1.53                  LinkInfoImpl.CONTEXT_ANNOTATION, annotationDoc);
    1.54              linkInfo.label = "@" + annotationDoc.name();
    1.55 @@ -2759,9 +2759,9 @@
    1.56              List<String> list = getAnnotations(0,
    1.57                  new AnnotationDesc[]{(AnnotationDesc) annotationValue.value()},
    1.58                      false);
    1.59 -            StringBuffer buf = new StringBuffer();
    1.60 -            for (Iterator<String> iter = list.iterator(); iter.hasNext(); ) {
    1.61 -                buf.append(iter.next());
    1.62 +            StringBuilder buf = new StringBuilder();
    1.63 +            for (String s: list) {
    1.64 +                buf.append(s);
    1.65              }
    1.66              return buf.toString();
    1.67          } else if (annotationValue.value() instanceof MemberDoc) {

mercurial