From 030577279efecd5eb4a0a3074581244ce69492f4 Mon Sep 17 00:00:00 2001
From: jakubs <jakubs>
Date: Thu, 16 Aug 2012 10:54:39 +0000
Subject: [PATCH] BIS-85 SP-217 Maintenance task to compute intensity level.
 Some refactoring

SVN: 26389
---
 ...puteIntensityLevelTransformationsMaintenanceTask.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/ComputeIntensityLevelTransformationsMaintenanceTask.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/ComputeIntensityLevelTransformationsMaintenanceTask.java
index 2b442d3c236..b68aa656240 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/ComputeIntensityLevelTransformationsMaintenanceTask.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/ComputeIntensityLevelTransformationsMaintenanceTask.java
@@ -130,8 +130,8 @@ public class ComputeIntensityLevelTransformationsMaintenanceTask implements IMai
                 Boolean.valueOf(properties.getProperty(COMPUTE_MIN_MAX_LEVELS_KEY,
                         DEFAULT_COMPUTE_MIN_MAX_LEVELS));
 
-        minLevel = Integer.valueOf(properties.getProperty(MIN_LEVEL_KEY, "-1"));
-        maxLevel = Integer.valueOf(properties.getProperty(MAX_LEVEL_KEY, "-1"));
+        minLevel = PropertyUtils.getInt(properties, MIN_LEVEL_KEY, -1);
+        maxLevel = PropertyUtils.getInt(properties, MAX_LEVEL_KEY, -1);
 
         if (false == computeMinMaxLevels)
         {
@@ -142,7 +142,8 @@ public class ComputeIntensityLevelTransformationsMaintenanceTask implements IMai
             }
         }
 
-        intensityThreshold = Float.valueOf(properties.getProperty(INTENSITY_THRESHOLD_KEY, "-1"));
+        intensityThreshold =
+                (float) PropertyUtils.getDouble(properties, INTENSITY_THRESHOLD_KEY, -1);
         if (computeMinMaxLevels && (intensityThreshold < 0 || intensityThreshold > 1))
         {
             throw new ConfigurationFailureException(
@@ -170,7 +171,7 @@ public class ComputeIntensityLevelTransformationsMaintenanceTask implements IMai
         String queueFilePath = PropertyUtils.getMandatoryProperty(properties, STATUS_FILENAME_KEY);
         queueFile = new File(queueFilePath);
 
-        batchSize = Integer.valueOf(properties.getProperty(BATCH_SIZE_KEY, "1"));
+        batchSize = PropertyUtils.getInt(properties, BATCH_SIZE_KEY, 1);
         if (batchSize < 1)
         {
             throw new ConfigurationFailureException("Batch size must be at least 1");
-- 
GitLab