From 1d7e1e31407a49f365b811145b566754250e416a Mon Sep 17 00:00:00 2001 From: Freddy Mallet Date: Sun, 17 Apr 2011 00:27:30 +0200 Subject: fix SONAR-2295 : Line number representation in source code view are wrong for files that use mixed line endings --- sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java | 1 + 1 file changed, 1 insertion(+) (limited to 'sonar-channel/src') 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 5515e7eb284..dbb28eb7b0b 100644 --- a/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java +++ b/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java @@ -94,6 +94,7 @@ 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++; -- cgit v1.2.3