aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-channel
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2012-09-28 10:46:40 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2012-09-28 10:46:40 +0400
commit4939a71b7d8a97e2bda14649c8381e3a983b0f25 (patch)
treed5d9cc052069d158b83f4eeabe9c242237ec402f /sonar-channel
parent2eb10e0f6089eed0d4cd3483f350db30a34c5cb6 (diff)
downloadsonarqube-4939a71b7d8a97e2bda14649c8381e3a983b0f25.tar.gz
sonarqube-4939a71b7d8a97e2bda14649c8381e3a983b0f25.zip
Fix some quality flaws
Diffstat (limited to 'sonar-channel')
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/ChannelException.java9
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/CodeReader.java2
-rw-r--r--sonar-channel/src/test/java/org/sonar/channel/CodeReaderTest.java2
3 files changed, 9 insertions, 4 deletions
diff --git a/sonar-channel/src/main/java/org/sonar/channel/ChannelException.java b/sonar-channel/src/main/java/org/sonar/channel/ChannelException.java
index af378f6a7bf..e38b69e600f 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/ChannelException.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/ChannelException.java
@@ -21,11 +21,16 @@ package org.sonar.channel;
public class ChannelException extends RuntimeException {
- public ChannelException(String message, Exception e) {
- super(message, e);
+ public ChannelException(String message, Exception cause) {
+ super(message, cause);
}
public ChannelException(String message) {
super(message);
}
+
+ public ChannelException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
}
diff --git a/sonar-channel/src/main/java/org/sonar/channel/CodeReader.java b/sonar-channel/src/main/java/org/sonar/channel/CodeReader.java
index 4ca2328186e..4a615b6fc03 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/CodeReader.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/CodeReader.java
@@ -194,7 +194,7 @@ public class CodeReader extends CodeBuffer {
throw new ChannelException("Unable to apply regular expression '" + matcher.pattern().pattern()
+ "' at line " + getCursor().getLine() + " and column " + getCursor().getColumn()
+ ", because it led to a stack overflow error."
- + " This error may be due to an inefficient use of alternations - see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507");
+ + " This error may be due to an inefficient use of alternations - see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507", e);
} catch (IndexOutOfBoundsException e) {
return -1;
} catch (IOException e) {
diff --git a/sonar-channel/src/test/java/org/sonar/channel/CodeReaderTest.java b/sonar-channel/src/test/java/org/sonar/channel/CodeReaderTest.java
index d52ae92b2aa..5ae280db679 100644
--- a/sonar-channel/src/test/java/org/sonar/channel/CodeReaderTest.java
+++ b/sonar-channel/src/test/java/org/sonar/channel/CodeReaderTest.java
@@ -101,7 +101,7 @@ public class CodeReaderTest {
}
@Test
- public void test() {
+ public void testStackOverflowError() {
StringBuilder sb = new StringBuilder();
sb.append("\n");
for (int i = 0; i < 10000; i++) {