aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-channel
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-10-23 11:12:33 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-10-23 11:12:33 +0200
commit8a8788fb4e8eb083935fdca81884f21fb443d6a4 (patch)
treeec0cb8c97db35104b1ceb85562e08616cb1e676c /sonar-channel
parentc408b3c0bf41d1b897d58f394a9a7133f53bfd1e (diff)
downloadsonarqube-8a8788fb4e8eb083935fdca81884f21fb443d6a4.tar.gz
sonarqube-8a8788fb4e8eb083935fdca81884f21fb443d6a4.zip
Fix quality flaws
Diffstat (limited to 'sonar-channel')
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/Channel.java4
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/ChannelCodeReaderFilter.java10
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java8
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/CodeReaderFilter.java10
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/RegexChannel.java6
5 files changed, 19 insertions, 19 deletions
diff --git a/sonar-channel/src/main/java/org/sonar/channel/Channel.java b/sonar-channel/src/main/java/org/sonar/channel/Channel.java
index 29c3c635bb6..69323d47214 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/Channel.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/Channel.java
@@ -19,7 +19,7 @@
*/
package org.sonar.channel;
-public abstract class Channel<OUTPUT> {
+public abstract class Channel<O> {
/**
* Tries to consume the character stream at the current reading cursor position (provided by the {@link org.sonar.channel.CodeReader}). If
@@ -31,5 +31,5 @@ public abstract class Channel<OUTPUT> {
* the OUTPUT that can be optionally fed by the Channel
* @return false if the Channel doesn't want to consume the character stream, true otherwise.
*/
- public abstract boolean consume(CodeReader code, OUTPUT output);
+ public abstract boolean consume(CodeReader code, O output);
}
diff --git a/sonar-channel/src/main/java/org/sonar/channel/ChannelCodeReaderFilter.java b/sonar-channel/src/main/java/org/sonar/channel/ChannelCodeReaderFilter.java
index 24a2c40dabc..4308a7ab7d9 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/ChannelCodeReaderFilter.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/ChannelCodeReaderFilter.java
@@ -27,10 +27,10 @@ import java.io.Reader;
* declared for the CodeReader.
*
*/
-public final class ChannelCodeReaderFilter<OUTPUT> extends CodeReaderFilter<OUTPUT> {
+public final class ChannelCodeReaderFilter<O> extends CodeReaderFilter<O> {
@SuppressWarnings("unchecked")
- private Channel<OUTPUT>[] channels = new Channel[0];
+ private Channel<O>[] channels = new Channel[0];
private CodeReader internalCodeReader;
@@ -40,7 +40,7 @@ public final class ChannelCodeReaderFilter<OUTPUT> extends CodeReaderFilter<OUTP
* @param channels
* the different channels
*/
- public ChannelCodeReaderFilter(Channel<OUTPUT>... channels) {
+ public ChannelCodeReaderFilter(Channel<O>... channels) {
super();
this.channels = channels;
}
@@ -54,7 +54,7 @@ public final class ChannelCodeReaderFilter<OUTPUT> extends CodeReaderFilter<OUTP
* @param channels
* the different channels
*/
- public ChannelCodeReaderFilter(OUTPUT output, Channel<OUTPUT>... channels) {
+ public ChannelCodeReaderFilter(O output, Channel<O>... channels) {
super(output);
this.channels = channels;
}
@@ -82,7 +82,7 @@ public final class ChannelCodeReaderFilter<OUTPUT> extends CodeReaderFilter<OUTP
break;
}
boolean consumed = false;
- for (Channel<OUTPUT> channel : channels) {
+ for (Channel<O> channel : channels) {
if (channel.consume(internalCodeReader, getOutput())) {
consumed = true;
break;
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 dfe85838d16..57378283de3 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java
@@ -27,12 +27,12 @@ import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class ChannelDispatcher<OUTPUT> extends Channel<OUTPUT> {
+public class ChannelDispatcher<O> extends Channel<O> {
private static final Logger LOG = LoggerFactory.getLogger(ChannelDispatcher.class);
private final boolean failIfNoChannelToConsumeOneCharacter;
- private final Channel<OUTPUT>[] channels;
+ private final Channel<O>[] channels;
/**
* @deprecated in version 2.9. Please use the builder() method
@@ -68,11 +68,11 @@ public class ChannelDispatcher<OUTPUT> extends Channel<OUTPUT> {
}
@Override
- public boolean consume(CodeReader code, OUTPUT output) {
+ public boolean consume(CodeReader code, O output) {
int nextChar = code.peek();
while (nextChar != -1) {
boolean characterConsumed = false;
- for (Channel<OUTPUT> channel : channels) {
+ for (Channel<O> channel : channels) {
if (channel.consume(code, output)) {
characterConsumed = true;
break;
diff --git a/sonar-channel/src/main/java/org/sonar/channel/CodeReaderFilter.java b/sonar-channel/src/main/java/org/sonar/channel/CodeReaderFilter.java
index d9d8f33433f..8f5e72039b8 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/CodeReaderFilter.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/CodeReaderFilter.java
@@ -33,18 +33,18 @@ import java.io.Reader;
* @see CodeBufferTest#testSeveralCodeReaderFilter()
*
*/
-public abstract class CodeReaderFilter<OUTPUT> {
+public abstract class CodeReaderFilter<O> {
private Reader reader;
- private OUTPUT output;
+ private O output;
private CodeReaderConfiguration configuration;
public CodeReaderFilter() {
}
- public CodeReaderFilter(OUTPUT output) {
+ public CodeReaderFilter(O output) {
this.output = output;
}
@@ -72,7 +72,7 @@ public abstract class CodeReaderFilter<OUTPUT> {
*
* @return the output
*/
- public OUTPUT getOutput() {
+ public O getOutput() {
return output;
}
@@ -82,7 +82,7 @@ public abstract class CodeReaderFilter<OUTPUT> {
* @param output
* the output to set
*/
- public void setOutput(OUTPUT output) {
+ public void setOutput(O output) {
this.output = output;
}
diff --git a/sonar-channel/src/main/java/org/sonar/channel/RegexChannel.java b/sonar-channel/src/main/java/org/sonar/channel/RegexChannel.java
index 145230f1473..fbcd2cc757e 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/RegexChannel.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/RegexChannel.java
@@ -25,7 +25,7 @@ import java.util.regex.Pattern;
/**
* The RegexChannel can be used to be called each time the next characters in the character stream match a regular expression
*/
-public abstract class RegexChannel<OUTPUT> extends Channel<OUTPUT> {
+public abstract class RegexChannel<O> extends Channel<O> {
private final StringBuilder tmpBuilder = new StringBuilder();
private final Matcher matcher;
@@ -41,7 +41,7 @@ public abstract class RegexChannel<OUTPUT> extends Channel<OUTPUT> {
}
@Override
- public final boolean consume(CodeReader code, OUTPUT output) {
+ public final boolean consume(CodeReader code, O output) {
if (code.popTo(matcher, tmpBuilder) > 0) {
consume(tmpBuilder, output);
tmpBuilder.delete(0, tmpBuilder.length());
@@ -59,6 +59,6 @@ public abstract class RegexChannel<OUTPUT> extends Channel<OUTPUT> {
* @param the
* OUPUT object which can be optionally fed
*/
- protected abstract void consume(CharSequence token, OUTPUT output);
+ protected abstract void consume(CharSequence token, O output);
}