camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [05/11] camel git commit: Fixed CS
Date Fri, 04 Mar 2016 14:00:38 GMT
Fixed CS


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

Branch: refs/heads/master
Commit: 1de99e9da7d74aad6a00f9c55cdd084454e9b691
Parents: aace174
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Mar 4 14:29:40 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Mar 4 14:29:40 2016 +0100

----------------------------------------------------------------------
 .../xslt/extensions/MyExtensionFunction1.java   | 57 +++++++++---------
 .../xslt/extensions/MyExtensionFunction2.java   | 63 ++++++++++----------
 .../SaxonSpringExtensionFunctionsTest.java      |  2 +-
 3 files changed, 60 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1de99e9d/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction1.java
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction1.java
b/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction1.java
index 251f7a0..f0130bb 100644
--- a/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction1.java
+++ b/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction1.java
@@ -1,4 +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.
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.xslt.extensions;
 
 import net.sf.saxon.expr.XPathContext;
@@ -33,11 +32,11 @@ import org.slf4j.LoggerFactory;
 
 public class MyExtensionFunction1 extends ExtensionFunctionDefinition {
 
-	private static final long serialVersionUID = 1L;
-	
-	private static final Logger LOG = LoggerFactory.getLogger(MyExtensionFunction1.class);
+    private static final long serialVersionUID = 1L;
+
+    private static final Logger LOG = LoggerFactory.getLogger(MyExtensionFunction1.class);
 
-	@Override
+    @Override
     public StructuredQName getFunctionQName() {
         return new StructuredQName("", "http://mytest/", "myExtensionFunction1");
     }
@@ -54,37 +53,37 @@ public class MyExtensionFunction1 extends ExtensionFunctionDefinition
{
 
     @Override
     public SequenceType[] getArgumentTypes() {
-        return new SequenceType[] { SequenceType.SINGLE_INTEGER, SequenceType.SINGLE_INTEGER
};
+        return new SequenceType[]{SequenceType.SINGLE_INTEGER, SequenceType.SINGLE_INTEGER};
     }
 
     @Override
     public SequenceType getResultType(SequenceType[] suppliedArgumentTypes) {
-    	int resultCardinality = 1;
-    	return SequenceType.makeSequenceType(SequenceType.SINGLE_INTEGER.getPrimaryType(), resultCardinality);
+        int resultCardinality = 1;
+        return SequenceType.makeSequenceType(SequenceType.SINGLE_INTEGER.getPrimaryType(),
resultCardinality);
     }
 
     @Override
     public ExtensionFunctionCall makeCallExpression() {
-    	return new ExtensionFunctionCall() {
-			private static final long serialVersionUID = 1L;
+        return new ExtensionFunctionCall() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public Sequence call(XPathContext xPathContext, Sequence[] arguments) throws
XPathException {
+                // 1st argument (mandatory, index 0)
+                Int64Value arg1 = (Int64Value) arguments[0].iterate().next();
+                int arg1Int = arg1.getDecimalValue().toBigInteger().intValue();
 
-			@Override
-	        public Sequence call(XPathContext xPathContext, Sequence[] arguments) throws XPathException
{
-				// 1st argument (mandatory, index 0)
-	            Int64Value arg1 = (Int64Value) arguments[0].iterate().next();
-	            int arg1Int = arg1.getDecimalValue().toBigInteger().intValue();
-	
-	            // 2nd argument (mandatory, index 1)
-	            Int64Value arg2 = (Int64Value) arguments[1].iterate().next();
-	            int arg2Int = arg2.getDecimalValue().toBigInteger().intValue();
-	            
-	            // Functionality goes here
-	            int resultInt = arg1Int + arg2Int;
-	
-	            Item result = new Int64Value(resultInt);
-	            return SequenceTool.toLazySequence(SingletonIterator.makeIterator(result));
-	        }
-		};
+                // 2nd argument (mandatory, index 1)
+                Int64Value arg2 = (Int64Value) arguments[1].iterate().next();
+                int arg2Int = arg2.getDecimalValue().toBigInteger().intValue();
+
+                // Functionality goes here
+                int resultInt = arg1Int + arg2Int;
+
+                Item result = new Int64Value(resultInt);
+                return SequenceTool.toLazySequence(SingletonIterator.makeIterator(result));
+            }
+        };
     }
-	
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1de99e9d/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction2.java
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction2.java
b/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction2.java
index f694233..260e4be 100644
--- a/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction2.java
+++ b/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/MyExtensionFunction2.java
@@ -1,4 +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.
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.xslt.extensions;
 
 import net.sf.saxon.expr.XPathContext;
@@ -33,11 +32,11 @@ import org.slf4j.LoggerFactory;
 
 public class MyExtensionFunction2 extends ExtensionFunctionDefinition {
 
-	private static final long serialVersionUID = 1L;
-	
-	private static final Logger LOG = LoggerFactory.getLogger(MyExtensionFunction2.class);
+    private static final long serialVersionUID = 1L;
+
+    private static final Logger LOG = LoggerFactory.getLogger(MyExtensionFunction2.class);
 
-	@Override
+    @Override
     public StructuredQName getFunctionQName() {
         return new StructuredQName("", "http://mytest/", "myExtensionFunction2");
     }
@@ -54,40 +53,40 @@ public class MyExtensionFunction2 extends ExtensionFunctionDefinition
{
 
     @Override
     public SequenceType[] getArgumentTypes() {
-        return new SequenceType[] { SequenceType.SINGLE_STRING, SequenceType.OPTIONAL_STRING
};
+        return new SequenceType[]{SequenceType.SINGLE_STRING, SequenceType.OPTIONAL_STRING};
     }
 
     @Override
     public SequenceType getResultType(SequenceType[] suppliedArgumentTypes) {
-    	int resultCardinality = 1;
-    	return SequenceType.makeSequenceType(SequenceType.SINGLE_STRING.getPrimaryType(), resultCardinality);
+        int resultCardinality = 1;
+        return SequenceType.makeSequenceType(SequenceType.SINGLE_STRING.getPrimaryType(),
resultCardinality);
     }
 
     @Override
     public ExtensionFunctionCall makeCallExpression() {
-    	return new ExtensionFunctionCall() {
-			private static final long serialVersionUID = 1L;
+        return new ExtensionFunctionCall() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public Sequence call(XPathContext xPathContext, Sequence[] arguments) throws
XPathException {
+                // 1st argument (mandatory, index 0)
+                StringValue arg1 = (StringValue) arguments[0].iterate().next();
+                String arg1Str = arg1.getStringValue();
 
-			@Override
-	        public Sequence call(XPathContext xPathContext, Sequence[] arguments) throws XPathException
{
-				// 1st argument (mandatory, index 0)
-	            StringValue arg1 = (StringValue) arguments[0].iterate().next();
-	            String arg1Str = arg1.getStringValue();
-	
-	            // 2nd argument (optional, index 1)
-	            String arg2Str = ""; 
-        		if ( arguments.length > 1 ) {
-        			StringValue arg2 = (StringValue) arguments[1].iterate().next();
-        			arg2Str = arg2.getStringValue();
-        		}
-	            
-	            // Functionality goes here
-	            String resultStr = arg1Str + arg2Str;
-	
-	            Item result = new StringValue(resultStr);
-	            return SequenceTool.toLazySequence(SingletonIterator.makeIterator(result));
-	        }
-		};
+                // 2nd argument (optional, index 1)
+                String arg2Str = "";
+                if (arguments.length > 1) {
+                    StringValue arg2 = (StringValue) arguments[1].iterate().next();
+                    arg2Str = arg2.getStringValue();
+                }
+
+                // Functionality goes here
+                String resultStr = arg1Str + arg2Str;
+
+                Item result = new StringValue(resultStr);
+                return SequenceTool.toLazySequence(SingletonIterator.makeIterator(result));
+            }
+        };
     }
-	
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1de99e9d/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/SaxonSpringExtensionFunctionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/SaxonSpringExtensionFunctionsTest.java
b/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/SaxonSpringExtensionFunctionsTest.java
index 4c3708a..39aae3d 100644
--- a/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/SaxonSpringExtensionFunctionsTest.java
+++ b/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/extensions/SaxonSpringExtensionFunctionsTest.java
@@ -1,4 +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.


Mime
View raw message