camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject camel git commit: fixed CS error
Date Sun, 01 Mar 2015 13:17:02 GMT
Repository: camel
Updated Branches:
  refs/heads/master 2cbd2a4eb -> 1bb97cc69


fixed CS error


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1bb97cc6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1bb97cc6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1bb97cc6

Branch: refs/heads/master
Commit: 1bb97cc6909231b777e8d0a300cb74f2dc2a1d9f
Parents: 2cbd2a4
Author: Christian Mueller <cmueller@apache.org>
Authored: Sun Mar 1 14:16:52 2015 +0100
Committer: Christian Mueller <cmueller@apache.org>
Committed: Sun Mar 1 14:16:52 2015 +0100

----------------------------------------------------------------------
 .../camel/maven/EipDocumentationEnricherMojo.java | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1bb97cc6/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java
b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java
index 15ac9be..aebd0b1 100644
--- a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java
+++ b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java
@@ -79,7 +79,7 @@ public class EipDocumentationEnricherMojo extends AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
-        Set<String> injectedTypes = new HashSet<>();
+        Set<String> injectedTypes = new HashSet<String>();
         File rootDir = new File(camelCoreDir, Constants.PATH_TO_MODEL_DIR);
         DomFinder domFinder = new DomFinder();
         DocumentationEnricher documentationEnricher = new DocumentationEnricher();
@@ -104,7 +104,9 @@ public class EipDocumentationEnricherMojo extends AbstractMojo {
                 }
             }
             saveToFile(document, outputCamelSchemaFile, buildTransformer());
-        } catch (XPathExpressionException | IOException e) {
+        } catch (XPathExpressionException e) {
+            throw new MojoExecutionException("Error during documentation enrichment", e);
+        } catch (IOException e) {
             throw new MojoExecutionException("Error during documentation enrichment", e);
         }
     }
@@ -134,7 +136,7 @@ public class EipDocumentationEnricherMojo extends AbstractMojo {
     }
 
     private Map<String, String> buildTypeToNameMap(NodeList elementsAndTypes) {
-        Map<String, String> typeToNameMap = new HashMap<>();
+        Map<String, String> typeToNameMap = new HashMap<String, String>();
         for (int i = 0; i < elementsAndTypes.getLength(); i++) {
             Element item = (Element) elementsAndTypes.item(i);
             String name = item.getAttribute(Constants.NAME_ATTRIBUTE_NAME);
@@ -180,7 +182,11 @@ public class EipDocumentationEnricherMojo extends AbstractMojo {
         try {
             builder = factory.newDocumentBuilder();
             result =  builder.parse(xml);
-        } catch (SAXException | ParserConfigurationException | IOException  e) {
+        } catch (SAXException e) {
+            throw new MojoExecutionException("Error during building a document", e);
+        } catch (ParserConfigurationException e) {
+            throw new MojoExecutionException("Error during building a document", e);
+        } catch (IOException  e) {
             throw new MojoExecutionException("Error during building a document", e);
         }
         return result;
@@ -191,7 +197,9 @@ public class EipDocumentationEnricherMojo extends AbstractMojo {
             StreamResult result = new StreamResult(new FileOutputStream(outputFile));
             DOMSource source = new DOMSource(document);
             transformer.transform(source, result);
-        } catch (FileNotFoundException | TransformerException e) {
+        } catch (TransformerException e) {
+            throw new MojoExecutionException("Error during saving to file", e);
+        } catch (FileNotFoundException e) {
             throw new MojoExecutionException("Error during saving to file", e);
         }
     }


Mime
View raw message