From aefd4d5ba7b9764c8eb7b0eaa3d2a4f7dfb427b8 Mon Sep 17 00:00:00 2001 From: Jarrod Greene Date: Thu, 30 May 2024 16:25:55 +0800 Subject: [PATCH] Update to disco to be more compliant with FOM module loading Disco was previously throwing an exception if two FOM modules defined the same parameter for a class. However according to the spec, this is fine, as long as the definition is the same. This now allows duplicate parameters. NOTE: currently assuming that parameters with the same name ARE the same, which is not necessarily the case. --- .../org/openlvc/disco/configuration/RprConfiguration.java | 4 +++- .../disco/connection/rpr/model/InteractionClass.java | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/codebase/src/java/disco/org/openlvc/disco/configuration/RprConfiguration.java b/codebase/src/java/disco/org/openlvc/disco/configuration/RprConfiguration.java index abd1dfd3..061f967d 100644 --- a/codebase/src/java/disco/org/openlvc/disco/configuration/RprConfiguration.java +++ b/codebase/src/java/disco/org/openlvc/disco/configuration/RprConfiguration.java @@ -491,7 +491,9 @@ private void loadDefaultModules() "hla/rpr2/RPR-Enumerations_v2.0.xml", "hla/rpr2/RPR-Physical_v2.0.xml", "hla/rpr2/RPR-SIMAN_v2.0.xml", - "hla/rpr2/RPR-Warfare_v2.0.xml" + "hla/rpr2/RPR-Warfare_v2.0.xml", + "hla/rpr2/RPR-Aggregate_v2.0.xml", + "hla/rpr2/RPR-SE_v2.0.xml", }; if( getRtiProvider() == RtiProvider.Mak ) diff --git a/codebase/src/java/disco/org/openlvc/disco/connection/rpr/model/InteractionClass.java b/codebase/src/java/disco/org/openlvc/disco/connection/rpr/model/InteractionClass.java index be98de76..ccfef8c5 100644 --- a/codebase/src/java/disco/org/openlvc/disco/connection/rpr/model/InteractionClass.java +++ b/codebase/src/java/disco/org/openlvc/disco/connection/rpr/model/InteractionClass.java @@ -97,8 +97,11 @@ public void addParameter( ParameterClass parameter ) // make sure we don't already have one by this name if( parameters.containsKey(parameter.getName()) ) { - throw new DiscoException( "Add Parameter Failed: Class [%s] already has parameter with name [%s]", - name, parameter.getName() ); + // FIXME - we'll assume that this parameter has the same definition - which makes this fine + // but if it were defined any differently we should error out. + return; + // throw new DiscoException( "Add Parameter Failed: Class [%s] already has parameter with name [%s]", + // name, parameter.getName() ); } // store the parameter