Skip to content

Commit

Permalink
Added more javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
johncurrier committed Oct 23, 2008
1 parent 4cf533c commit 211ed20
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/net/sourceforge/schemaspy/util/HtmlEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@ public static String encodeToken(String str) {
return (result == null) ? str : result;
}

/**
* Returns an HTML-encoded version of the specified string
*
* @param str
* @return
*/
public static String encodeString(String str) {
int len = str.length();
StringBuilder s = new StringBuilder(len * 2);
StringBuilder buf = new StringBuilder(len * 2); // x2 should limit # of reallocs
for (int i = 0; i < len; i++) {
s.append(encodeToken(str.charAt(i)));
buf.append(encodeToken(str.charAt(i)));
}
return s.toString();
return buf.toString();
}
}

0 comments on commit 211ed20

Please sign in to comment.