Updated Branches: refs/heads/master 40dbd2ef4 -> eba07da4e
Fixed the CS error of tooling module Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/23da7dd4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/23da7dd4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/23da7dd4 Branch: refs/heads/master Commit: 23da7dd4ba590536b4b8d8d3749ac24b5f146960 Parents: 40dbd2e Author: Willem Jiang <ningji...@apache.org> Authored: Tue May 7 14:37:02 2013 +0800 Committer: Willem Jiang <ningji...@apache.org> Committed: Tue May 7 14:37:02 2013 +0800 ---------------------------------------------------------------------- .../tools/apt/EndpointAnnotationProcessor.java | 43 +++++++-------- .../org/apache/camel/tools/apt/util/Func1.java | 7 +-- .../org/apache/camel/tools/apt/util/Strings.java | 8 ++- .../apache/camel/maven/packaging/EndpointMojo.java | 13 ++--- 4 files changed, 34 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/23da7dd4/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java ---------------------------------------------------------------------- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java index ddc1d26..b06930d 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java @@ -1,5 +1,4 @@ /** - * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -7,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -17,11 +16,19 @@ */ package org.apache.camel.tools.apt; -import org.apache.camel.spi.UriEndpoint; -import org.apache.camel.spi.UriParam; -import org.apache.camel.spi.UriParams; -import org.apache.camel.tools.apt.util.Func1; -import org.apache.camel.tools.apt.util.Strings; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.io.Writer; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Filer; @@ -40,19 +47,12 @@ import javax.lang.model.util.Elements; import javax.tools.Diagnostic; import javax.tools.FileObject; import javax.tools.StandardLocation; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.io.Writer; -import java.net.URI; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeMap; + +import org.apache.camel.spi.UriEndpoint; +import org.apache.camel.spi.UriParam; +import org.apache.camel.spi.UriParams; +import org.apache.camel.tools.apt.util.Func1; +import org.apache.camel.tools.apt.util.Strings; /** * Processes all Camel endpoints @@ -297,9 +297,6 @@ public class EndpointAnnotationProcessor extends AbstractProcessor { } else { file.getParentFile().mkdirs(); out = new FileWriter(file); - if (out == null) { - out = resource.openWriter(); - } writer = new PrintWriter(out); handler.call(writer); } http://git-wip-us.apache.org/repos/asf/camel/blob/23da7dd4/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Func1.java ---------------------------------------------------------------------- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Func1.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Func1.java index a0f7adc..cdd3199 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Func1.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Func1.java @@ -1,5 +1,4 @@ /** - * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -7,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,6 +19,6 @@ package org.apache.camel.tools.apt.util; /** * Represents a function with 1 argument */ -public interface Func1<T1,R> { - public R call(T1 t1); +public interface Func1<T1, R> { + R call(T1 t1); } http://git-wip-us.apache.org/repos/asf/camel/blob/23da7dd4/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Strings.java ---------------------------------------------------------------------- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Strings.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Strings.java index bd733c6..74df4dd 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Strings.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/util/Strings.java @@ -1,5 +1,4 @@ /** - * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -7,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,7 +19,10 @@ package org.apache.camel.tools.apt.util; /** * Some String helper methods */ -public class Strings { +public final class Strings { + private Strings() { + //Helper class + } /** * Returns true if the given text is null or empty string */ http://git-wip-us.apache.org/repos/asf/camel/blob/23da7dd4/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointMojo.java ---------------------------------------------------------------------- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointMojo.java index 085e531..4c63ac1 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointMojo.java @@ -1,5 +1,4 @@ /** - * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -7,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -83,11 +82,11 @@ public class EndpointMojo extends AbstractMavenReport { sink.title(); sink.text("Camel Endpoints"); sink.title_(); - sink.rawText("<style>\n" + - "th, td {\n" + - " text-align:left;\n\n" + - "}\n" + - "</style>\n"); + sink.rawText("<style>\n" + + "th, td {\n" + + " text-align:left;\n\n" + + "}\n" + + "</style>\n"); sink.head_(); sink.body();