[PATCH 2 of 6] issue1394: Minor refactoring

Wald Commits scm-commit at wald.intevation.org
Thu Jul 18 12:32:47 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1374143586 -7200
# Node ID 661faf99d24007e6c84dc3a14f2d210e7d217813
# Parent  266864819f0b9622392fa95f914650495e41e0fc
issue1394: Minor refactoring.

diff -r 266864819f0b -r 661faf99d240 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageTwinPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageTwinPanel.java	Thu Jul 18 12:32:14 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageTwinPanel.java	Thu Jul 18 12:33:06 2013 +0200
@@ -277,6 +277,10 @@
         this.removedPairs.add(pr);
     }
 
+    /**
+     * Set factory of recommendation such that the correct artifacts will
+     * be cloned for difference calculations.
+     */
     public void adjustRecommendation(Recommendation recommendation) {
         if (recommendation.getIDs() != null) {
             GWT.log("Setting staticwkms factory for rec with ID "
@@ -323,29 +327,10 @@
                 // Check whether one of those is a dike or similar.
                 // TODO differentiate and merge: new clones, new, old.
                 Recommendation firstR = r.getFirst();
-                if(firstR.getIDs() != null) {
-                    GWT.log("First IDs: " + firstR.getIDs() + " factory: "
-                            + firstR.getFactory());
-                }
-                if(firstR.getIDs() != null) {
-                    // These do not get cloned but loaded ("spawned").
-                    firstR.setFactory("staticwkms");
-                }
-                else {
-                    firstR.setFactory("waterlevel");
-                }
+                adjustRecommendation(firstR);
+
                 Recommendation secondR = r.getSecond();
-                if(secondR.getIDs() != null) {
-                    GWT.log("Second IDs: " + secondR.getIDs() + " factory: "
-                            + secondR.getFactory());
-                }
-                if (secondR.getIDs() != null) {
-                    // These do not get cloned but loaded ("spawned").
-                    secondR.setFactory("staticwkms");
-                }
-                else {
-                    secondR.setFactory("waterlevel");
-                }
+                adjustRecommendation(secondR);
 
                 ar.add(firstR);
                 ar.add(secondR);


More information about the Dive4elements-commits mailing list