From c673e6481c83a97dddf625b5ff7fa071107f21fb Mon Sep 17 00:00:00 2001
From: Dominique Marcadet <Dominique.Marcadet@centralesupelec.fr>
Date: Mon, 3 Feb 2020 18:04:33 +0100
Subject: [PATCH] Complement to commit 9785b448 which was not enough to solve
 issue

---
 .../nsd/DataObjectPresenceConditionValidator.java        | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataObjectPresenceConditionValidator.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataObjectPresenceConditionValidator.java
index 69e137a..86aba5c 100644
--- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataObjectPresenceConditionValidator.java
+++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataObjectPresenceConditionValidator.java
@@ -140,11 +140,18 @@ public class DataObjectPresenceConditionValidator {
         // condition.
         // To do this, we put a non null dictionary for the corresponding condition in the root,
         // and duplicate it in each sub-LNClass for adding specific elements
-        if( parent == null ) {
+        if( base == null ) {
             atLeastOne = new HashMap<>();
         }
         else {
             atLeastOne = ( HashMap< Integer, HashSet< String > > ) base.atLeastOne.clone();
+            // We also need to add corresponding keys in presentDO
+            for( Integer group : atLeastOne.keySet() ) {
+                for( String name : atLeastOne.get( group )) {
+                    presentDO.put( name, null );
+                }
+            }
+            
         }
 
         anyLNClass
-- 
GitLab