diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-06-28 08:42:53 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-06-28 08:43:11 +0200 |
commit | 4e1655566e26035164f644b0a933e7c0e7891436 (patch) | |
tree | 7229e1f543abd0a76be2f2b34e313f6adfea760d /sonar-channel/src/main | |
parent | 595485bb2bf8b327cb50e24597894d97d28c178d (diff) | |
download | sonarqube-4e1655566e26035164f644b0a933e7c0e7891436.tar.gz sonarqube-4e1655566e26035164f644b0a933e7c0e7891436.zip |
Add method ChannelDispatcher.Builder#addChannels(Channel...) + minor fixes
Diffstat (limited to 'sonar-channel/src/main')
-rw-r--r-- | sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java | 17 | ||||
-rw-r--r-- | sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java b/sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java index 58b8c95afba..d21ac683abd 100644 --- a/sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java +++ b/sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java @@ -36,7 +36,7 @@ public class ChannelDispatcher<OUTPUT> extends Channel<OUTPUT> { private final Channel[] channels; /** - * @deprecated please use the builder() method + * @deprecated in version 2.9. Please use the builder() method */ @SuppressWarnings("rawtypes") @Deprecated @@ -45,7 +45,7 @@ public class ChannelDispatcher<OUTPUT> extends Channel<OUTPUT> { } /** - * @deprecated please use the builder() method + * @deprecated in version 2.9. Please use the builder() method */ @SuppressWarnings("rawtypes") @Deprecated @@ -54,7 +54,7 @@ public class ChannelDispatcher<OUTPUT> extends Channel<OUTPUT> { } /** - * @deprecated please use the builder() method + * @deprecated in version 2.9. Please use the builder() method */ @SuppressWarnings("rawtypes") @Deprecated @@ -94,6 +94,10 @@ public class ChannelDispatcher<OUTPUT> extends Channel<OUTPUT> { return true; } + Channel[] getChannels() { + return channels; + } + /** * Get a Builder instance to build a new ChannelDispatcher */ @@ -114,6 +118,13 @@ public class ChannelDispatcher<OUTPUT> extends Channel<OUTPUT> { return this; } + public Builder addChannels(Channel... c) { + for (Channel channel : c) { + addChannel(channel); + } + return this; + } + /** * If this option is activated, an IllegalStateException will be thrown as soon as a character won't be consumed by any channel. */ 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 6373bb0ff40..7274181662e 100644 --- a/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java +++ b/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java @@ -48,13 +48,11 @@ public class CodeBuffer implements CharSequence { private static final char LF = '\n'; private static final char CR = '\r'; private int tabWidth; - private CodeReaderConfiguration configuration; private boolean recordingMode = false; private StringBuilder recordedCharacters = new StringBuilder(); protected CodeBuffer(Reader initialCodeReader, CodeReaderConfiguration configuration) { - this.configuration = configuration; lastChar = -1; cursor = new Cursor(); bufferCapacity = configuration.getBufferCapacity(); |