[PATCH] So you do not need to type every string twice

Wald Commits scm-commit at wald.intevation.org
Tue Jun 17 17:51:02 CEST 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1403020259 -7200
# Node ID 5ef60ed15c254d6cf2e78800ba1640ea5810e484
# Parent  6f8f13d829e5537a3104b430ef2600945d4494f9
So you do not need to type every string twice.

diff -r 6f8f13d829e5 -r 5ef60ed15c25 artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java	Tue Jun 17 09:54:40 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java	Tue Jun 17 17:50:59 2014 +0200
@@ -263,6 +263,9 @@
             request, XPATH_FACET, ArtifactNamespaceContext.INSTANCE);
     }
 
+    protected String msg(String key) {
+        return Resources.getMsg(context.getMeta(), key, key);
+    }
 
     protected String msg(String key, String def) {
         return Resources.getMsg(context.getMeta(), key, def);
diff -r 6f8f13d829e5 -r 5ef60ed15c25 artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Tue Jun 17 09:54:40 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Tue Jun 17 17:50:59 2014 +0200
@@ -130,17 +130,17 @@
 
     protected void writeCSVHeader(CSVWriter writer) {
         writer.writeNext(new String[] {
-            msg(CSV_KM        , CSV_KM),
-            msg(CSV_PARAMETER,  CSV_PARAMETER),
-            msg(CSV_COEFF_A   , CSV_COEFF_A),
-            msg(CSV_COEFF_B   , CSV_COEFF_B),
-            msg(CSV_SD, CSV_SD),
-            msg(CSV_QMAX, CSV_QMAX),
-            msg(CSV_COEFF_R, CSV_COEFF_R),
-            msg(CSV_N_TOTAL   , CSV_N_TOTAL),
-            msg(CSV_N_OUTLIERS, CSV_N_OUTLIERS),
-            msg(CSV_C_DUAN, CSV_C_DUAN),
-            msg(CSV_C_FERGUSON, CSV_C_FERGUSON)
+            msg(CSV_KM),
+            msg(CSV_PARAMETER),
+            msg(CSV_COEFF_A),
+            msg(CSV_COEFF_B),
+            msg(CSV_SD),
+            msg(CSV_QMAX),
+            msg(CSV_COEFF_R),
+            msg(CSV_N_TOTAL),
+            msg(CSV_N_OUTLIERS),
+            msg(CSV_C_DUAN),
+            msg(CSV_C_FERGUSON)
         });
     }
 


More information about the Dive4Elements-commits mailing list