You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/01/16 04:55:09 UTC

[camel] 01/02: Fixed CS

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit cdc6aedcbb385256c703944dc241ff18fe117845
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Jan 16 05:54:38 2020 +0100

    Fixed CS
---
 .../java/org/apache/camel/xml/in/BaseParser.java    | 10 +++++-----
 .../java/org/apache/camel/xml/in/ModelParser.java   |  4 +++-
 .../main/java/org/apache/camel/xml/io/MXParser.java | 19 +++++++++++++++++++
 .../java/org/apache/camel/xml/io/XmlPullParser.java | 19 +++++++++++++++++++
 .../apache/camel/xml/io/XmlPullParserException.java | 19 +++++++++++++++++++
 .../org/apache/camel/xml/io/XmlStreamReader.java    | 21 ++++++++++++++++++++-
 .../camel/xml/io/XmlStreamReaderException.java      | 19 +++++++++++++++++++
 .../org/apache/camel/xml/in/ModelParserTest.java    | 14 +++++++-------
 8 files changed, 111 insertions(+), 14 deletions(-)

diff --git a/core/camel-xml-io/src/main/java/org/apache/camel/xml/in/BaseParser.java b/core/camel-xml-io/src/main/java/org/apache/camel/xml/in/BaseParser.java
index b081e4a..281d6f2 100644
--- a/core/camel-xml-io/src/main/java/org/apache/camel/xml/in/BaseParser.java
+++ b/core/camel-xml-io/src/main/java/org/apache/camel/xml/in/BaseParser.java
@@ -146,7 +146,7 @@ public class BaseParser {
         existing.add(element);
     }
 
-    protected <V, B> B unmarshal(XmlAdapter<V,B> adapter, V value) throws XmlPullParserException {
+    protected <V, B> B unmarshal(XmlAdapter<V, B> adapter, V value) throws XmlPullParserException {
         try {
             return adapter.unmarshal(value);
         } catch (Exception e) {
@@ -192,13 +192,13 @@ public class BaseParser {
 
     protected void expectTag(String name) throws XmlPullParserException, IOException {
         if (parser.nextTag() != XmlPullParser.START_TAG) {
-            throw new XmlPullParserException("Expected starting tag '{" + namespace + "}" + name + "', read ending tag '{" +
-                    parser.getNamespace() + "}" + parser.getName() + "' instead");
+            throw new XmlPullParserException("Expected starting tag '{" + namespace + "}" + name + "', read ending tag '{"
+                    + parser.getNamespace() + "}" + parser.getName() + "' instead");
         }
         if (!Objects.equals(name, parser.getName())
                 || !Objects.equals(namespace, parser.getNamespace())) {
-            throw new XmlPullParserException("Expected starting tag '{" + namespace + "}" + name + "', read starting tag '{" +
-                    parser.getNamespace() + "}" + parser.getName() + "' instead");
+            throw new XmlPullParserException("Expected starting tag '{" + namespace + "}" + name + "', read starting tag '{"
+                    + parser.getNamespace() + "}" + parser.getName() + "' instead");
         }
     }
 
diff --git a/core/camel-xml-io/src/main/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/main/java/org/apache/camel/xml/in/ModelParser.java
index 1b4ed77..41e7d1d 100644
--- a/core/camel-xml-io/src/main/java/org/apache/camel/xml/in/ModelParser.java
+++ b/core/camel-xml-io/src/main/java/org/apache/camel/xml/in/ModelParser.java
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 package org.apache.camel.xml.in;
+// CHECKSTYLE:OFF
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -3030,4 +3031,5 @@ public class ModelParser extends BaseParser {
             default: return null;
         }
     }
-}
\ No newline at end of file
+}
+// CHECKSTYLE:ON
diff --git a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/MXParser.java b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/MXParser.java
index 1126078..95c9059 100644
--- a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/MXParser.java
+++ b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/MXParser.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 /* -*-             c-basic-offset: 4; indent-tabs-mode: nil; -*-  //------100-columns-wide------>|*/
 /*
  * Copyright (c) 2003 Extreme! Lab, Indiana University. All rights reserved.
@@ -8,6 +25,7 @@
  */
 
 package org.apache.camel.xml.io;
+// CHECKSTYLE:OFF
 
 import java.io.EOFException;
 import java.io.IOException;
@@ -3241,3 +3259,4 @@ public class MXParser
  * SOFTWARE.
  */
 
+// CHECKSTYLE:ON
\ No newline at end of file
diff --git a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlPullParser.java b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlPullParser.java
index f31a090..4f8083a 100644
--- a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlPullParser.java
+++ b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlPullParser.java
@@ -1,7 +1,25 @@
+/*
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 /* -*-             c-basic-offset: 4; indent-tabs-mode: nil; -*-  //------100-columns-wide------>|*/
 // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/)
 
 package org.apache.camel.xml.io;
+// CHECKSTYLE:OFF
 
 import java.io.InputStream;
 import java.io.IOException;
@@ -962,3 +980,4 @@ public interface XmlPullParser
             throws XmlPullParserException, IOException;
 
 }
+// CHECKSTYLE:ON
\ No newline at end of file
diff --git a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlPullParserException.java b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlPullParserException.java
index 2d9c9d1..c4d564a 100644
--- a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlPullParserException.java
+++ b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlPullParserException.java
@@ -1,7 +1,25 @@
+/*
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 /* -*-             c-basic-offset: 4; indent-tabs-mode: nil; -*-  //------100-columns-wide------>|*/
 // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/)
 
 package org.apache.camel.xml.io;
+// CHECKSTYLE:OFF
 
 /**
  * This exception is thrown to signal XML Pull Parser related faults.
@@ -53,3 +71,4 @@ public class XmlPullParserException
     }
 
 }
+// CHECKSTYLE:ON
diff --git a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReader.java b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReader.java
index a3d52a7..6e0bc62 100644
--- a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReader.java
+++ b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReader.java
@@ -1,4 +1,21 @@
 /*
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
  * Copyright 2004 Sun Microsystems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +32,7 @@
  *
  */
 package org.apache.camel.xml.io;
+// CHECKSTYLE:OFF
 
 import java.io.BufferedInputStream;
 import java.io.File;
@@ -744,4 +762,5 @@ public class XmlStreamReader extends Reader {
         return mime != null && (mime.equals("text/xml") || mime.equals("text/xml-external-parsed-entity") || mime.startsWith("text/") && mime.endsWith("+xml"));
     }
 
-}
\ No newline at end of file
+}
+// CHECKSTYLE:ON
diff --git a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReaderException.java b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReaderException.java
index 97d798c..5336ed4 100644
--- a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReaderException.java
+++ b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReaderException.java
@@ -1,4 +1,21 @@
 /*
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
  * Copyright 2004 Sun Microsystems, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +32,7 @@
  *
  */
 package org.apache.camel.xml.io;
+// CHECKSTYLE:OFF
 
 import java.io.InputStream;
 import java.io.IOException;
@@ -148,3 +166,4 @@ public class XmlStreamReaderException extends IOException {
         return is;
     }
 }
+// CHECKSTYLE:ON
\ No newline at end of file
diff --git a/core/camel-xml-io/src/test/java/org/apache/camel/xml/in/ModelParserTest.java b/core/camel-xml-io/src/test/java/org/apache/camel/xml/in/ModelParserTest.java
index c90a932..2ca21f5 100644
--- a/core/camel-xml-io/src/test/java/org/apache/camel/xml/in/ModelParserTest.java
+++ b/core/camel-xml-io/src/test/java/org/apache/camel/xml/in/ModelParserTest.java
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertNotNull;
 public class ModelParserTest {
 
     public static final String NAMESPACE = "http://camel.apache.org/schema/spring";
-    private static List<String> REST_XMLS = Arrays.asList("barRest.xml", "simpleRest.xml", "simpleRestToD.xml");
+    private static final List<String> REST_XMLS = Arrays.asList("barRest.xml", "simpleRest.xml", "simpleRestToD.xml");
 
     @Test
     public void testFiles() throws Exception {
@@ -55,12 +55,12 @@ public class ModelParserTest {
     @Test
     public void testSimpleString() throws Exception {
         RoutesDefinition routes = new ModelParser(new StringReader(
-                "<routes>" +
-                        "<route id='foo'>" +
-                            "<from uri='my:bar'/>" +
-                            "<to uri='mock:res'/>" +
-                        "</route>" +
-                "</routes>"
+                "<routes>"
+                    + "  <route id='foo'>"
+                    + "    <from uri='my:bar'/>"
+                    + "    <to uri='mock:res'/>"
+                    + "  </route>"
+                    + "</routes>"
         )).parseRoutesDefinition();
         assertNotNull(routes);
     }