From 3772ad754d19094fb5934e9046e681f2d58f73fe Mon Sep 17 00:00:00 2001
From: anhefti <andreas.hefti@let.ethz.ch>
Date: Thu, 21 Nov 2019 16:13:47 +0100
Subject: [PATCH] prepare for version 0.5.1-beta

---
 pom.xml                                            |  2 +-
 .../dao/impl/ConfigurationDAOBatchService.java     |  2 +-
 .../sebconfig/impl/ExamConfigXMLParser.java        | 14 ++++++++------
 src/main/resources/config/application.properties   |  2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index 211709f1..41ece343 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
   <packaging>jar</packaging>
 
   <properties>
-    <sebserver-version>0.5.0-beta</sebserver-version>
+    <sebserver-version>0.5.1-beta</sebserver-version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
   </properties>
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java
index 4762fb36..90d7a719 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java
@@ -716,7 +716,7 @@ class ConfigurationDAOBatchService {
                     });
 
             // override with template values if available
-            if (configNode.templateId == null || configNode.templateId == ConfigurationNode.DEFAULT_TEMPLATE_ID) {
+            if (configNode.templateId == null || configNode.templateId.equals(ConfigurationNode.DEFAULT_TEMPLATE_ID)) {
                 initAdditionalDefaultValues(configNode, config);
             } else {
                 writeTemplateValues(configNode, config);
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigXMLParser.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigXMLParser.java
index 3e6c8879..4119abb9 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigXMLParser.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigXMLParser.java
@@ -312,19 +312,22 @@ public class ExamConfigXMLParser extends DefaultHandler {
                     "Failed to get InlineTable values. value/name array length mismatch");
         }
 
-        String val = "";
+        final StringBuilder valueBuilder = new StringBuilder();
         for (int i = 0; i < names.length; i++) {
             if (i != 0) {
                 if (i % numColumns == 0) {
-                    val = val + Constants.LIST_SEPARATOR;
+                    valueBuilder.append(Constants.LIST_SEPARATOR);
                 } else {
-                    val = val + Constants.EMBEDDED_LIST_SEPARATOR;
+                    valueBuilder.append(Constants.EMBEDDED_LIST_SEPARATOR);
                 }
             }
-            val = val + names[i] + Constants.FORM_URL_ENCODED_NAME_VALUE_SEPARATOR + values[i];
+            valueBuilder
+                    .append(names[i])
+                    .append(Constants.FORM_URL_ENCODED_NAME_VALUE_SEPARATOR)
+                    .append(values[i]);
         }
 
-        saveValue(attrName, attribute, top.listIndex, val);
+        saveValue(attrName, attribute, top.listIndex, valueBuilder.toString());
     }
 
     @Override
@@ -460,7 +463,6 @@ public class ExamConfigXMLParser extends DefaultHandler {
         int listIndex = 0;
         String valueName;
         String value;
-        boolean saveNullValueAsBlank = false;
 
         protected PListNode(final Type type) {
             this.type = type;
diff --git a/src/main/resources/config/application.properties b/src/main/resources/config/application.properties
index a00678b7..8f30f0f3 100644
--- a/src/main/resources/config/application.properties
+++ b/src/main/resources/config/application.properties
@@ -5,6 +5,6 @@ spring.mandatory-file-encoding=UTF-8
 spring.http.encoding.charset=UTF-8
 spring.http.encoding.enabled=true
 
-sebserver.version=0.5.0 beta
+sebserver.version=0.5.1 beta
 sebserver.supported.languages=en,de