Browse Source

Fix some quality flaws

tags/3.3
Evgeny Mandrikov 11 years ago
parent
commit
4939a71b7d

+ 7
- 2
sonar-channel/src/main/java/org/sonar/channel/ChannelException.java View File

@@ -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);
}

}

+ 1
- 1
sonar-channel/src/main/java/org/sonar/channel/CodeReader.java View File

@@ -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) {

+ 1
- 1
sonar-channel/src/test/java/org/sonar/channel/CodeReaderTest.java View File

@@ -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++) {

Loading…
Cancel
Save