diff options
author | Freddy Mallet <freddy.mallet@gmail.com> | 2011-04-23 00:46:05 +0200 |
---|---|---|
committer | Freddy Mallet <freddy.mallet@gmail.com> | 2011-04-23 00:46:05 +0200 |
commit | 84159b5d85a0b99790ba8ea90e463076d541ed5c (patch) | |
tree | c6f52c84eb62aa8e287b48d07765297daf61f9f2 /sonar-channel | |
parent | b6f08e746d29a10f73c9e37ea828f093d68a89bd (diff) | |
download | sonarqube-84159b5d85a0b99790ba8ea90e463076d541ed5c.tar.gz sonarqube-84159b5d85a0b99790ba8ea90e463076d541ed5c.zip |
SONAR-2384 First implementation : Create a markdown dedicated to Sonar needs
Diffstat (limited to 'sonar-channel')
-rw-r--r-- | sonar-channel/pom.xml | 28 | ||||
-rw-r--r-- | sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java | 14 |
2 files changed, 27 insertions, 15 deletions
diff --git a/sonar-channel/pom.xml b/sonar-channel/pom.xml index f61178ddd83..517bc38f164 100644 --- a/sonar-channel/pom.xml +++ b/sonar-channel/pom.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.codehaus.sonar</groupId> @@ -20,15 +21,20 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest-all</artifactId> - <scope>test</scope> - </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-all</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project>
\ No newline at end of file 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 aaab3cf97c8..d772d81ffd5 100644 --- a/sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java +++ b/sonar-channel/src/main/java/org/sonar/channel/ChannelDispatcher.java @@ -20,6 +20,7 @@ package org.sonar.channel; +import java.util.Arrays; import java.util.List; import org.slf4j.Logger; @@ -34,13 +35,18 @@ public class ChannelDispatcher<OUTPUT> extends Channel<OUTPUT> { private final Channel[] channels; @SuppressWarnings("rawtypes") - public ChannelDispatcher(List<Channel> tokenizers) { - this(tokenizers, false); + public ChannelDispatcher(List<Channel> channels) { + this(channels, false); } @SuppressWarnings("rawtypes") - public ChannelDispatcher(List<Channel> tokenizers, boolean failIfNoChannelToConsumeOneCharacter) { - this.channels = tokenizers.toArray(new Channel[0]); // NOSONAR, lack of performance is not an issue here + public ChannelDispatcher(Channel... channels) { + this(Arrays.asList(channels), false); + } + + @SuppressWarnings("rawtypes") + public ChannelDispatcher(List<Channel> channels, boolean failIfNoChannelToConsumeOneCharacter) { + this.channels = channels.toArray(new Channel[0]); // NOSONAR, lack of performance is not an issue here this.failIfNoChannelToConsumeOneCharacter = failIfNoChannelToConsumeOneCharacter; } |