From 8783d5c97cd1e5617b496457f581a764c95018f0 Mon Sep 17 00:00:00 2001
From: brinn <brinn>
Date: Sun, 1 Aug 2010 18:04:57 +0000
Subject: [PATCH] change: ensure the feature vectors always have the same
 length, i.e. missing features for individual vectors are not left out but
 retained as NaN; thus the index of a feature is always the same over a set of
 feature vectors obtained in one API call

SVN: 17312
---
 .../dss/generic/server/FeatureTableBuilder.java        | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/FeatureTableBuilder.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/FeatureTableBuilder.java
index 852635edc66..b8d9a74d66e 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/FeatureTableBuilder.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/FeatureTableBuilder.java
@@ -131,14 +131,14 @@ public class FeatureTableBuilder
         }
         for (String featureName : featureNames)
         {
+            if (featureNameToIndexMap.containsKey(featureName) == false)
+            {
+                featureNameToIndexMap.put(featureName,
+                        new Integer(featureNameToIndexMap.size()));
+            }
             final ImgFeatureDefDTO featureDefinition = featureNameToDefMap.get(featureName);
             if (featureDefinition != null)
             {
-                if (featureNameToIndexMap.containsKey(featureName) == false)
-                {
-                    featureNameToIndexMap.put(featureName,
-                            new Integer(featureNameToIndexMap.size()));
-                }
                 List<ImgFeatureValuesDTO> featureValueSets =
                         dao.getFeatureValues(featureDefinition);
                 if (featureValueSets.isEmpty())
-- 
GitLab