Skip to content

Commit

Permalink
[squid:S1149] Synchronized classes Vector, Hashtable, Stack and Strin…
Browse files Browse the repository at this point in the history
…gBuffer should not be used
  • Loading branch information
AymanDF committed May 28, 2016
1 parent 228459e commit ea3e1e2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Expand Up @@ -101,7 +101,7 @@ private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
StringBuilder expected = new StringBuilder();
int maxSize = 0;
for (int i = 0; i < expectedTokenSequences.length; i++) {
if (maxSize < expectedTokenSequences[i].length) {
Expand Down Expand Up @@ -151,7 +151,7 @@ private static String initialise(Token currentToken,
* string literal.
*/
static String add_escapes(String str) {
StringBuffer retval = new StringBuffer();
StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
Expand Down
Expand Up @@ -60,7 +60,7 @@ public class TokenMgrError extends Error
* equivalents in the given string
*/
protected static final String addEscapes(String str) {
StringBuffer retval = new StringBuffer();
StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
Expand Down
Expand Up @@ -56,7 +56,7 @@ public CommentsCollection parse(final InputStream in, final String charsetName)
State state = State.CODE;
LineComment currentLineComment = null;
BlockComment currentBlockComment = null;
StringBuffer currentContent = null;
StringBuilder currentContent = null;

int currLine = 1;
int currCol = 1;
Expand All @@ -78,13 +78,13 @@ public CommentsCollection parse(final InputStream in, final String charsetName)
currentLineComment.setBeginLine(currLine);
currentLineComment.setBeginColumn(currCol - 1);
state = State.IN_LINE_COMMENT;
currentContent = new StringBuffer();
currentContent = new StringBuilder();
} else if (prevTwoChars.peekLast().equals('/') && c == '*') {
currentBlockComment = new BlockComment();
currentBlockComment.setBeginLine(currLine);
currentBlockComment.setBeginColumn(currCol - 1);
state = State.IN_BLOCK_COMMENT;
currentContent = new StringBuffer();
currentContent = new StringBuilder();
} else if (c == '"') {
state = State.IN_STRING;
} else if (c == '\'') {
Expand Down
Expand Up @@ -233,7 +233,7 @@ public TypeUsage replaceTypeParams(TypeUsage typeUsage) {

@Override
public String describe() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if (hasName()) {
sb.append(typeDeclaration.getQualifiedName());
} else {
Expand Down

0 comments on commit ea3e1e2

Please sign in to comment.