[PATCH] Fixed: was using java 7 features in java 6 code

Wald Commits scm-commit at wald.intevation.org
Tue Jul 3 13:06:50 CEST 2018


# HG changeset patch
# User gernotbelger
# Date 1530615656 -7200
# Node ID de55d9a94796cf116e2340c3ee6c823148c2d4db
# Parent  f7f226666c59eeff8a0362fd7f0fe1f1f8726b99
Fixed: was using java 7 features in java 6 code

diff -r f7f226666c59 -r de55d9a94796 gwt-client/src/test/java/test/AbstractModuleRunner.java
--- a/gwt-client/src/test/java/test/AbstractModuleRunner.java	Tue Jul 03 11:29:58 2018 +0200
+++ b/gwt-client/src/test/java/test/AbstractModuleRunner.java	Tue Jul 03 13:00:56 2018 +0200
@@ -65,6 +65,8 @@
         sinfo
     }
 
+    private static final String lineSeparator = System.getProperty("line.separator");
+
     private final String serverUrl = "http://localhost:8181";
     private final String locale = "de";
     private final HttpClient client;
@@ -171,14 +173,14 @@
 
         final String[] states = artifact.getArtifactDescription().getReachableStates();
         if (states != null) {
-            if (states.length > index) {
+
+            if (states.length > index)
                 return states[index];
-            } else {
-                return states[0];
-            }
-        } else {
-            return "";
+
+            return states[0];
         }
+
+        return "";
     }
 
     private final void feed(final Data[] data) throws ServerException, ConnectionException {
@@ -270,11 +272,11 @@
 
     private final String deleteErstelldatum(final String input) {
         String result = "";
-        final String[] lines = input.split(System.lineSeparator());
+        final String[] lines = input.split(lineSeparator);
         for (final String line : lines) {
             if (!line.contains(AbstractModuleRunner.IGNORE_ERSTELLDATUM) && !line.contains(AbstractModuleRunner.IGNORE_FLYS_VERSION)
                     && !line.contains(AbstractModuleRunner.IGNORE_BEARBEITER)) {
-                result = result + line + System.lineSeparator();
+                result = result + line + lineSeparator;
             }
         }
         return result;
@@ -340,5 +342,4 @@
 
         return rec1.getRecommendationPairString(rec2, getCollection(), this.serverUrl, this.locale);
     }
-
-}
+}
\ No newline at end of file


More information about the Dive4Elements-commits mailing list