Skip to content

Commit d7d88db

Browse files
committed
Fixed checkstyle issues and method visibility
1 parent 02478a0 commit d7d88db

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

jsoar-debugger/src/main/java/org/jsoar/debugger/ParseSelectedText.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public String toString()
222222
protected static final int K_CURR_TOKEN = 1;
223223
protected static final int K_NEXT_TOKEN = 2;
224224
protected String[] m_Tokens = new String[3];
225-
protected static final char[] kWhiteSpaceChars = { ' ', '\n', '\r', ')', '(', '{', '}' };
225+
protected static final char[] WHITE_SPACE_CHARS = { ' ', '\n', '\r', ')', '(', '{', '}' };
226226

227227
// The raw values
228228
protected String m_FullText;
@@ -455,7 +455,7 @@ public SelectedObject getParsedObject(JSoarDebugger debugger)
455455

456456
protected boolean isWhiteSpace(char ch)
457457
{
458-
for(char kWhiteSpaceChar : kWhiteSpaceChars)
458+
for(char kWhiteSpaceChar : WHITE_SPACE_CHARS)
459459
{
460460
if(kWhiteSpaceChar == ch)
461461
{
@@ -506,8 +506,8 @@ protected void parseTokens()
506506
else
507507
{
508508
// there was no preceding attribute start. Since we have nothing to anchor on, we'll assume that the current token does not have spaces.
509-
final int currentTokenStart = lastIndexOfSet(currentLine, kWhiteSpaceChars, currentLineSelection) + 1; // add 1 because don't want to include whitespace in token
510-
final int currentTokenEnd = indexOfSet(currentLine, kWhiteSpaceChars, currentLineSelection);
509+
final int currentTokenStart = lastIndexOfSet(currentLine, WHITE_SPACE_CHARS, currentLineSelection) + 1; // add 1 because don't want to include whitespace in token
510+
final int currentTokenEnd = indexOfSet(currentLine, WHITE_SPACE_CHARS, currentLineSelection);
511511
// careful! can't just change the values in currentTokenBounds, because it's pointing to NOT_FOUND. Need to make a new array.
512512
currentTokenBounds = new int[] {currentTokenStart, currentTokenEnd};
513513
}
@@ -544,7 +544,8 @@ protected void parseTokens()
544544

545545
private static final int[] NOT_FOUND = {-1, -1};
546546

547-
private int[] getCurrentLineBounds() {
547+
private int[] getCurrentLineBounds()
548+
{
548549
int lineStart = m_FullText.lastIndexOf('\n', m_SelectionStart);
549550
if(lineStart == -1)
550551
{
@@ -559,7 +560,8 @@ private int[] getCurrentLineBounds() {
559560
return new int[] {lineStart, lineEnd};
560561
}
561562

562-
int nextNonWhitespaceCharIndex(String text, int startPos) {
563+
private int nextNonWhitespaceCharIndex(String text, int startPos)
564+
{
563565
final int len = text.length();
564566
while(startPos < len && isWhiteSpace(text.charAt(startPos)))
565567
{
@@ -569,7 +571,8 @@ int nextNonWhitespaceCharIndex(String text, int startPos) {
569571
return startPos;
570572
}
571573

572-
int prevNonWhitespaceCharIndex(String text, int endPos) {
574+
private int prevNonWhitespaceCharIndex(String text, int endPos)
575+
{
573576

574577
while(endPos >= 0 && isWhiteSpace(text.charAt(endPos)))
575578
{
@@ -610,7 +613,7 @@ private int getTokenEnd(String text, int tokenStart)
610613
else
611614
{
612615
// token ends at whitespace
613-
tokenEnd = indexOfSet(text, kWhiteSpaceChars, tokenStart + 1);
616+
tokenEnd = indexOfSet(text, WHITE_SPACE_CHARS, tokenStart + 1);
614617
}
615618

616619
if(tokenEnd == -1)
@@ -637,7 +640,7 @@ private int getTokenStart(String text, int tokenEnd)
637640
else
638641
{
639642
// token starts at whitespace
640-
tokenStart = lastIndexOfSet(text, kWhiteSpaceChars, tokenEnd - 1) + 1; // add 1 because we don't want to include the space in the token
643+
tokenStart = lastIndexOfSet(text, WHITE_SPACE_CHARS, tokenEnd - 1) + 1; // add 1 because we don't want to include the space in the token
641644
}
642645

643646
if(tokenStart == -1)

0 commit comments

Comments
 (0)