aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-channel
diff options
context:
space:
mode:
authorfmallet <freddy.mallet@gmail.com>2010-11-25 09:24:10 +0000
committerfmallet <freddy.mallet@gmail.com>2010-11-25 09:24:10 +0000
commitf60082353d5380ef4924acc7612579ea3b7e6eb3 (patch)
tree6666d24cd2ef70345763811ab6efb4b7fdb341c6 /sonar-channel
parentfdbe3c66666a1e7aac5472de2c77c95ae181164f (diff)
downloadsonarqube-f60082353d5380ef4924acc7612579ea3b7e6eb3.tar.gz
sonarqube-f60082353d5380ef4924acc7612579ea3b7e6eb3.zip
fix SONAR-2010 : The ChannelReader doesn't allow a regular expression to consume more than 8'000 characters
Diffstat (limited to 'sonar-channel')
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java10
1 files changed, 9 insertions, 1 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 34cdb51ad1d..acabfb14467 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java
@@ -240,8 +240,16 @@ public class CodeBuffer implements CharSequence {
return buffer[bufferPosition + index];
}
+ /**
+ * Warning : this method always returns Integer.MAX_VALUE
+ * as the length of the stream can't be known before having consumed
+ * all characters.
+ *
+ * Integer.MAX_VALUE is returned to prevent regular expression matchers
+ * to stop consuming the stream of characters (see http://jira.codehaus.org/browse/SONAR-2010)
+ */
public final int length() {
- return bufferSize;
+ return Integer.MAX_VALUE;
}
public final CharSequence subSequence(int start, int end) {