Repository: camel Updated Branches: refs/heads/master 7d2ae4945 -> 5b6c49c3e
Upgrade to newer checkstyle and fix all the errors that pop up. Still problem with checkstyle in Eclipse due to a bug in Checkstyle > 6.6 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5b6c49c3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5b6c49c3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5b6c49c3 Branch: refs/heads/master Commit: 5b6c49c3e6edb1fd06508547636b61924524aea5 Parents: 7d2ae49 Author: Daniel Kulp <[email protected]> Authored: Wed Aug 26 14:55:44 2015 -0400 Committer: Daniel Kulp <[email protected]> Committed: Wed Aug 26 14:55:44 2015 -0400 ---------------------------------------------------------------------- .../src/main/resources/camel-checkstyle.xml | 11 ++++++- .../support/RestConsumerContextPathMatcher.java | 4 +++ .../org/apache/camel/builder/xml/XPathTest.java | 10 ++++--- .../component/aws/swf/SWFConfiguration.java | 4 ++- .../dozer/DozerTypeConverterLoader.java | 4 +-- .../jbpm/JBPMComponentIntegrationTest.java | 4 +-- .../camel/component/jt400/Jt400Endpoint.java | 8 ++++-- ...ndingPreservePostFormUrlEncodedBodyTest.java | 3 +- ...ttyHttpBindingUseRelativePathInPostTest.java | 3 +- .../component/rabbitmq/RabbitMQConsumer.java | 6 ++-- .../internal/processor/XmlRestProcessor.java | 30 ++++++++++---------- .../xmlsecurity/SignatureAlgorithmTest.java | 12 ++++++-- .../zookeeper/policy/ZookeeperElectionTest.java | 4 ++- parent/pom.xml | 25 +++++++--------- .../commands/EndpointStatisticCommand.java | 7 +++-- 15 files changed, 82 insertions(+), 53 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/buildingtools/src/main/resources/camel-checkstyle.xml ---------------------------------------------------------------------- diff --git a/buildingtools/src/main/resources/camel-checkstyle.xml b/buildingtools/src/main/resources/camel-checkstyle.xml index afe2e25..4c60fc6 100644 --- a/buildingtools/src/main/resources/camel-checkstyle.xml +++ b/buildingtools/src/main/resources/camel-checkstyle.xml @@ -339,9 +339,18 @@ lengths, if/try depths, etc... <!--<module name="UncommentedMain"/>--> <!--module name="TrailingComment"/--> <module name="Indentation"> + <property name="lineWrappingIndentation" value="0"/> <property name="caseIndent" value="0"/> </module> <!--<module name="RequiredRegexp">--> </module> - <module name="SuppressionCommentFilter"/> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="CHECKSTYLE\:OFF"/> + <property name="onCommentFormat" value="CHECKSTYLE\:ON"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="CHECKSTYLE.OFF\:([\w\|]+)"/> + <property name="onCommentFormat" value="CHECKSTYLE.ON\:([\w\|]+)"/> + <property name="checkFormat" value="$1"/> + </module> </module> http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/camel-core/src/main/java/org/apache/camel/support/RestConsumerContextPathMatcher.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/support/RestConsumerContextPathMatcher.java b/camel-core/src/main/java/org/apache/camel/support/RestConsumerContextPathMatcher.java index 2cbbf9c..2ae50a7 100644 --- a/camel-core/src/main/java/org/apache/camel/support/RestConsumerContextPathMatcher.java +++ b/camel-core/src/main/java/org/apache/camel/support/RestConsumerContextPathMatcher.java @@ -30,6 +30,10 @@ import java.util.Locale; * The {@link ConsumerPath} is used for the components to provide the details to the matcher. */ public final class RestConsumerContextPathMatcher { + private RestConsumerContextPathMatcher() { + + } + /** * Consumer path details which must be implemented and provided by the components. http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java b/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java index 26247a4..316400c 100644 --- a/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java +++ b/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java @@ -30,15 +30,17 @@ import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFunctionResolver; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + + import org.apache.camel.ContextTestSupport; import org.apache.camel.Exchange; import org.apache.camel.Expression; import org.apache.camel.Predicate; import org.apache.camel.util.ObjectHelper; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; import static org.apache.camel.builder.xml.XPathBuilder.xpath; http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java index 88e1596..cdc4633 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java @@ -327,7 +327,9 @@ public class SWFConfiguration { this.activitySchedulingOptions = activitySchedulingOptions; } - public int getActivityThreadPoolSize() { return activityThreadPoolSize; } + public int getActivityThreadPoolSize() { + return activityThreadPoolSize; + } /** * Maximum number of threads in work pool for activity. http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java ---------------------------------------------------------------------- diff --git a/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java b/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java index 6696115..9d6d3ae 100644 --- a/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java +++ b/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java @@ -16,8 +16,6 @@ */ package org.apache.camel.converter.dozer; -import static org.dozer.classmap.MappingDirection.ONE_WAY; - import java.lang.reflect.Field; import java.net.MalformedURLException; import java.net.URL; @@ -48,6 +46,8 @@ import org.dozer.util.DozerClassLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.dozer.classmap.MappingDirection.ONE_WAY; + /** * <code>DozerTypeConverterLoader</code> provides the mechanism for registering * a Dozer {@link Mapper} as {@link TypeConverter} for a {@link CamelContext}. http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-jbpm/src/test/java/org/apache/camel/component/jbpm/JBPMComponentIntegrationTest.java ---------------------------------------------------------------------- diff --git a/components/camel-jbpm/src/test/java/org/apache/camel/component/jbpm/JBPMComponentIntegrationTest.java b/components/camel-jbpm/src/test/java/org/apache/camel/component/jbpm/JBPMComponentIntegrationTest.java index cdb7b50..0b53c6a 100644 --- a/components/camel-jbpm/src/test/java/org/apache/camel/component/jbpm/JBPMComponentIntegrationTest.java +++ b/components/camel-jbpm/src/test/java/org/apache/camel/component/jbpm/JBPMComponentIntegrationTest.java @@ -40,8 +40,8 @@ public class JBPMComponentIntegrationTest extends CamelTestSupport { @Override public void configure() { from("direct:rest") - .to("jbpm:http://localhost:8080/business-central?userName=bpmsAdmin&password=pa$word1" + - "&deploymentId=org.kie.example:project1:1.0.0-SNAPSHOT") + .to("jbpm:http://localhost:8080/business-central?userName=bpmsAdmin&password=pa$word1" + + "&deploymentId=org.kie.example:project1:1.0.0-SNAPSHOT") .to("mock:result"); } }; http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java index 1e89550..c102ed7 100644 --- a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java +++ b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java @@ -247,8 +247,12 @@ public class Jt400Endpoint extends DefaultPollingEndpoint { configuration.setSystemName(systemName); } - public void setSecured(boolean secured) { configuration.setSecured(secured); } + public void setSecured(boolean secured) { + configuration.setSecured(secured); + } - public boolean isSecured() { return configuration.isSecured(); } + public boolean isSecured() { + return configuration.isSecured(); + } } http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingPreservePostFormUrlEncodedBodyTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingPreservePostFormUrlEncodedBodyTest.java b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingPreservePostFormUrlEncodedBodyTest.java index 861c227..868574c 100644 --- a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingPreservePostFormUrlEncodedBodyTest.java +++ b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingPreservePostFormUrlEncodedBodyTest.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.netty4.http; +import io.netty.handler.codec.http.FullHttpRequest; + import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.Processor; @@ -23,7 +25,6 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.http.HttpMethods; import org.junit.Test; -import io.netty.handler.codec.http.FullHttpRequest; public class NettyHttpBindingPreservePostFormUrlEncodedBodyTest extends BaseNettyTest { http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingUseRelativePathInPostTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingUseRelativePathInPostTest.java b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingUseRelativePathInPostTest.java index 39ed697..e8a6da2 100644 --- a/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingUseRelativePathInPostTest.java +++ b/components/camel-netty4-http/src/test/java/org/apache/camel/component/netty4/http/NettyHttpBindingUseRelativePathInPostTest.java @@ -16,13 +16,14 @@ */ package org.apache.camel.component.netty4.http; +import io.netty.handler.codec.http.FullHttpRequest; + import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.http.HttpMethods; import org.junit.Test; -import io.netty.handler.codec.http.FullHttpRequest; public class NettyHttpBindingUseRelativePathInPostTest extends BaseNettyTest { http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java index 1fded4d..a6027ea 100644 --- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java +++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java @@ -139,8 +139,7 @@ public class RabbitMQConsumer extends DefaultConsumer { for (RabbitConsumer consumer : this.consumers) { try { consumer.stop(); - } - catch (TimeoutException e) { + } catch (TimeoutException e) { log.error("Timeout occured"); throw e; } @@ -261,8 +260,7 @@ public class RabbitMQConsumer extends DefaultConsumer { } try { channel.close(); - } - catch (TimeoutException e) { + } catch (TimeoutException e) { log.error("Timeout occured"); throw e; } http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java ---------------------------------------------------------------------- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java index f11bc2f..1a31e20 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java @@ -56,22 +56,22 @@ public class XmlRestProcessor extends AbstractRestProcessor { // not very efficient when both JSON and XML are used together with a single Thread pool // but this will do for now private static ThreadLocal<XStream> xStream = - new ThreadLocal<XStream>() { - @Override - protected XStream initialValue() { - // use NoNameCoder to avoid escaping __ in custom field names - // and CompactWriter to avoid pretty printing - XStream result = new XStream(new XppDriver(new NoNameCoder()) { - @Override - public HierarchicalStreamWriter createWriter(Writer out) { - return new CompactWriter(out, getNameCoder()); - } + new ThreadLocal<XStream>() { + @Override + protected XStream initialValue() { + // use NoNameCoder to avoid escaping __ in custom field names + // and CompactWriter to avoid pretty printing + XStream result = new XStream(new XppDriver(new NoNameCoder()) { + @Override + public HierarchicalStreamWriter createWriter(Writer out) { + return new CompactWriter(out, getNameCoder()); + } - }); - result.registerConverter(new JodaTimeConverter()); - return result; - } - }; + }); + result.registerConverter(new JodaTimeConverter()); + return result; + } + }; private static final String RESPONSE_ALIAS = XmlRestProcessor.class.getName() + ".responseAlias"; http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java ---------------------------------------------------------------------- diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java index 17e2116..fe73c9f 100644 --- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java +++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java @@ -626,9 +626,15 @@ public class SignatureAlgorithmTest extends CamelTestSupport { return new SecretKey() { private static final long serialVersionUID = 5629454124145851381L; - public String getFormat() { return "RAW"; } - public byte[] getEncoded() { return secret; } - public String getAlgorithm() { return "SECRET"; } + public String getFormat() { + return "RAW"; + } + public byte[] getEncoded() { + return secret; + } + public String getAlgorithm() { + return "SECRET"; + } }; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/policy/ZookeeperElectionTest.java ---------------------------------------------------------------------- diff --git a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/policy/ZookeeperElectionTest.java b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/policy/ZookeeperElectionTest.java index fd63cee..f9562f0 100644 --- a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/policy/ZookeeperElectionTest.java +++ b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/policy/ZookeeperElectionTest.java @@ -112,7 +112,9 @@ public class ZookeeperElectionTest extends ZooKeeperTestSupport { final AtomicBoolean notified = new AtomicBoolean(false); ElectionWatcher watcher = new ElectionWatcher() { - @Override public void electionResultChanged() { notified.set(true); } + @Override public void electionResultChanged() { + notified.set(true); + } }; ZooKeeperElection electionCandidate1 = createElectionCandidate(candidateOneContext, 2); http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index c21480c..205f654 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -339,9 +339,11 @@ <maven-bundle-version>${maven-bundle-plugin-version}</maven-bundle-version> <!-- problems by upgrading to maven-bundle-plugin 2.4.0 --> <maven-bundle-plugin-version>2.3.7</maven-bundle-plugin-version> - <!-- maven-checkstyle-plugin 2.10 has problems to validate the license header in properties files--> - <maven-checkstyle-plugin-version>2.9.1</maven-checkstyle-plugin-version> - <maven-checkstyle-version>5.6</maven-checkstyle-version> + <maven-checkstyle-plugin-version>2.16</maven-checkstyle-plugin-version> + <!-- AtomicException.java causes a problem with Checksyle > 6.6 due to + https://github.com/checkstyle/checkstyle/issues/1903 + --> + <maven-checkstyle-version>6.6</maven-checkstyle-version> <maven-eclipse-plugin-version>2.9</maven-eclipse-plugin-version> <maven-javadoc-plugin-version>2.9.1</maven-javadoc-plugin-version> <maven-jboss-as-maven-plugin-version>7.7.Final</maven-jboss-as-maven-plugin-version> @@ -2781,27 +2783,22 @@ <version>${maven-checkstyle-plugin-version}</version> <dependencies> <dependency> - <groupId>com.puppycrawl.tools</groupId> - <artifactId>checkstyle</artifactId> - <version>${maven-checkstyle-version}</version> - <exclusions> - <exclusion> - <groupId>com.sun</groupId> - <artifactId>tools</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-buildtools</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.puppycrawl.tools</groupId> + <artifactId>checkstyle</artifactId> + <version>${maven-checkstyle-version}</version> + </dependency> </dependencies> <executions> <execution> <id>validate</id> <phase>validate</phase> <configuration> + <includeResources>false</includeResources> <configLocation>camel-checkstyle.xml</configLocation> <consoleOutput>true</consoleOutput> <failsOnError>true</failsOnError> http://git-wip-us.apache.org/repos/asf/camel/blob/5b6c49c3/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/EndpointStatisticCommand.java ---------------------------------------------------------------------- diff --git a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/EndpointStatisticCommand.java b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/EndpointStatisticCommand.java index d123414..48d1b21 100644 --- a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/EndpointStatisticCommand.java +++ b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/EndpointStatisticCommand.java @@ -81,8 +81,11 @@ public class EndpointStatisticCommand extends AbstractCamelCommand { for (Map<String, String> row : entry.getValue()) { if (!header) { - out.println(String.format(headerFormat, CONTEXT_COLUMN_LABEL, URI_COLUMN_LABEL, ROUTE_COLUMN_LABEL, DIRECTION_COLUMN_LABEL, STATIC_COLUMN_LABEL, DYNAMIC_COLUMN_LABEL, HITS_COLUMN_LABEL)); - out.println(String.format(headerFormat, "-------", "---", "--------", "---------", "------", "-------", "-------")); + out.println(String.format(headerFormat, CONTEXT_COLUMN_LABEL, URI_COLUMN_LABEL, + ROUTE_COLUMN_LABEL, DIRECTION_COLUMN_LABEL, STATIC_COLUMN_LABEL, + DYNAMIC_COLUMN_LABEL, HITS_COLUMN_LABEL)); + out.println(String.format(headerFormat, "-------", "---", "--------", + "---------", "------", "-------", "-------")); header = true; }
