[PATCH] Datacage function resolver: Declare static functions static

Wald Commits scm-commit at wald.intevation.org
Thu Jun 26 13:00:23 CEST 2014


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1403780418 -7200
# Node ID 912cf4ec09d1cffc7a1df888740bd922f704c628
# Parent  09c9920e6f24d49b1cf3d94d12aec920934beb97
Datacage function resolver: Declare static functions static.

diff -r 09c9920e6f24 -r 912cf4ec09d1 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Thu Jun 26 12:54:31 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Thu Jun 26 13:00:18 2014 +0200
@@ -255,7 +255,7 @@
     }
 
     /** Implementation of case-ignoring dc:contains. */
-    public Object contains(List args) throws XPathFunctionException {
+    public static Object contains(List args) throws XPathFunctionException {
         Object haystack = args.get(0);
         Object needle   = args.get(1);
 
@@ -299,7 +299,7 @@
     /** Implementation for getting the minimum value of location or distance
      *  dc:fromValue.
      */
-    public Object fromValue(List args) throws XPathFunctionException {
+    public static Object fromValue(List args) throws XPathFunctionException {
         Object mode      = args.get(0);
         Object locations = args.get(1);
         Object from      = args.get(2);
@@ -345,7 +345,7 @@
     /** Implementation for getting the maximum value of location or distance
      *  dc:toValue.
      */
-    public Object toValue(List args) throws XPathFunctionException {
+    public static Object toValue(List args) throws XPathFunctionException {
         Object mode      = args.get(0);
         Object locations = args.get(1);
         Object to        = args.get(2);
@@ -393,7 +393,7 @@
     /** Implementation for doing a string replace
      *  dc:replace .
      */
-    public Object replace(List args) throws XPathFunctionException {
+    public static Object replace(List args) throws XPathFunctionException {
         Object haystack    = args.get(0);
         Object needle      = args.get(1);
         Object replacement = args.get(2);
@@ -410,7 +410,7 @@
     /** Implementation for doing a string replace
      *  dc:replace-all
      */
-    public Object replaceAll(List args) throws XPathFunctionException {
+    public static Object replaceAll(List args) throws XPathFunctionException {
         Object haystack    = args.get(0);
         Object needle      = args.get(1);
         Object replacement = args.get(2);
@@ -424,7 +424,7 @@
         return haystack;
     }
 
-    public Object dateFormat(List args) throws XPathFunctionException {
+    public static Object dateFormat(List args) throws XPathFunctionException {
         Object pattern = args.get(0);
         Object date    = args.get(1);
 
@@ -449,7 +449,7 @@
         return "";
     }
 
-    public Set<String> allStateSuccessors(String artifactName, String stateId) {
+    public static Set<String> allStateSuccessors(String artifactName, String stateId) {
         GlobalContext gc = RiverContextFactory.getGlobalContext();
         if (gc == null) {
             return Collections.<String>emptySet();
@@ -462,7 +462,7 @@
         return Collections.<String>emptySet();
     }
 
-    public Collection<String> findAll(String needle, String haystack) {
+    public static Collection<String> findAll(String needle, String haystack) {
 
         ArrayList<String> result = new ArrayList<String>();
 
@@ -474,7 +474,7 @@
         return result;
     }
 
-    public Number maxNumber(Object list) {
+    public static Number maxNumber(Object list) {
         if (list instanceof Collection) {
             Collection collection = (Collection)list;
             double max = -Double.MAX_VALUE;
@@ -514,7 +514,7 @@
             : Double.valueOf(Double.MAX_VALUE);
     }
 
-    public Number minNumber(Object list) {
+    public static Number minNumber(Object list) {
         if (list instanceof Collection) {
             Collection collection = (Collection)list;
             double min = Double.MAX_VALUE;


More information about the Dive4Elements-commits mailing list