diff options
author | Freddy Mallet <freddy.mallet@gmail.com> | 2011-04-22 22:56:10 +0200 |
---|---|---|
committer | Freddy Mallet <freddy.mallet@gmail.com> | 2011-04-22 22:56:10 +0200 |
commit | b6f08e746d29a10f73c9e37ea828f093d68a89bd (patch) | |
tree | 0a253bc68ed515b0f9572107760b0e21fb72f041 /sonar-channel/src/main/java/org/sonar | |
parent | db1f420129792b3da40d85903b993c5b4bd74d76 (diff) | |
download | sonarqube-b6f08e746d29a10f73c9e37ea828f093d68a89bd.tar.gz sonarqube-b6f08e746d29a10f73c9e37ea828f093d68a89bd.zip |
Sonar Channel : Slightly improve the readability of the source code in charge to increment the line number
Diffstat (limited to 'sonar-channel/src/main/java/org/sonar')
-rw-r--r-- | sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java b/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java index dbb28eb7b0b..25ad180b4b3 100644 --- a/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java +++ b/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java @@ -94,11 +94,9 @@ public class CodeBuffer implements CharSequence { } private void updateCursorPosition(int character) { - //see Java Language Specification : http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.4 - if (character == LF || character == CR) { - if ((lastChar != LF && lastChar != CR) || lastChar == character || lastChar == LF) { - cursor.line++; - } + // see Java Language Specification : http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.4 + if (character == LF || (character == CR && peek() != LF)) { + cursor.line++; cursor.column = 0; } else if (character == '\t') { cursor.column += tabWidth; |