From 87b71d5c5a0cc5d44f2f80469446a731b0b92068 Mon Sep 17 00:00:00 2001 From: Enquier Date: Thu, 25 Aug 2022 14:59:25 -0600 Subject: [PATCH 01/11] Create stale.yml --- .github/stale.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000..7c4e86674 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: true From 76c6a2799686cfdae6c1115d77c5f0b49d03b996 Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Wed, 16 Nov 2022 18:49:52 -0800 Subject: [PATCH 02/11] fix #238 --- .../mdk/mms/sync/manual/ManualSyncRunner.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/manual/ManualSyncRunner.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/manual/ManualSyncRunner.java index 8da154ef7..f176809fa 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/manual/ManualSyncRunner.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/manual/ManualSyncRunner.java @@ -87,7 +87,7 @@ public void run(ProgressStatus progressStatus) { int loopDepth = depth; collectClientElementsRecursively(project, element, loopDepth, clientElements, clientIdsVisited); try { - File searchFile = searchForServerElements(project, element, progressStatus); + File searchFile = searchForServerElements(project, element, loopDepth, progressStatus); if(searchFile != null) { responseFiles.add(searchFile); } @@ -113,7 +113,7 @@ public void run(ProgressStatus progressStatus) { elementValidator.run(progressStatus); } - private File searchForServerElements(Project project, Element element, ProgressStatus progressStatus) + private File searchForServerElements(Project project, Element element, int depth, ProgressStatus progressStatus) throws ServerException, IOException, URISyntaxException, GeneralSecurityException { Collection nodeIds = new HashSet<>(); // this is a collection because the createEntityFile method expects it if(element.equals(project.getPrimaryModel())) { @@ -121,10 +121,19 @@ private File searchForServerElements(Project project, Element element, ProgressS } else { nodeIds.add(element.getLocalID()); } - File sendData = MMSUtils.createEntityFile(this.getClass(), ContentType.APPLICATION_JSON, nodeIds, MMSUtils.JsonBlobType.SEARCH); - HttpRequestBase searchRequest = MMSUtils.prepareEndpointBuilderBasicJsonPostRequest(MMSSearchEndpoint.builder(), project, sendData) - .addParam(MMSEndpointBuilderConstants.URI_PROJECT_SUFFIX, Converters.getIProjectToIdConverter().apply(project.getPrimaryProject())) - .addParam(MMSEndpointBuilderConstants.URI_REF_SUFFIX, MDUtils.getBranchId(project)).build(); + File sendData; + HttpRequestBase searchRequest; + if (depth == 0) { + sendData = MMSUtils.createEntityFile(this.getClass(), ContentType.APPLICATION_JSON, nodeIds, MMSUtils.JsonBlobType.ELEMENT_ID); + searchRequest = MMSUtils.prepareEndpointBuilderBasicJsonPutRequest(MMSElementsEndpoint.builder(), project, sendData) + .addParam(MMSEndpointBuilderConstants.URI_PROJECT_SUFFIX, Converters.getIProjectToIdConverter().apply(project.getPrimaryProject())) + .addParam(MMSEndpointBuilderConstants.URI_REF_SUFFIX, MDUtils.getBranchId(project)).build(); + } else { + sendData = MMSUtils.createEntityFile(this.getClass(), ContentType.APPLICATION_JSON, nodeIds, MMSUtils.JsonBlobType.SEARCH); + searchRequest = MMSUtils.prepareEndpointBuilderBasicJsonPostRequest(MMSSearchEndpoint.builder(), project, sendData) + .addParam(MMSEndpointBuilderConstants.URI_PROJECT_SUFFIX, Converters.getIProjectToIdConverter().apply(project.getPrimaryProject())) + .addParam(MMSEndpointBuilderConstants.URI_REF_SUFFIX, MDUtils.getBranchId(project)).build(); + } // use endpoint to make request return MMSUtils.sendMMSRequest(project, searchRequest, progressStatus); } From 70baad0fe9ee7b3abbc8953087ce821ad231e3a3 Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Thu, 17 Nov 2022 14:55:23 -0800 Subject: [PATCH 03/11] fix for single element commit action --- .../jpl/mbee/mdk/mms/actions/CommitClientElementAction.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/CommitClientElementAction.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/CommitClientElementAction.java index 04aade71d..2f100ee85 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/CommitClientElementAction.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/CommitClientElementAction.java @@ -111,6 +111,9 @@ public void actionPerformed(@CheckForNull ActionEvent actionEvent) { List elementsToUpdate = new ArrayList<>(1); List elementsToDelete = new ArrayList<>(1); if (elementObjectNode != null) { + if (serverObjectNode != null && serverObjectNode.get(MDKConstants.CONTENTS_KEY) != null && !serverObjectNode.get(MDKConstants.CONTENTS_KEY).isEmpty()) { + elementObjectNode.set(MDKConstants.CONTENTS_KEY, serverObjectNode.get(MDKConstants.CONTENTS_KEY)); + } elementsToUpdate.add(elementObjectNode); } else { From ae5d935a990f03a959a37f29488f55db107094b5 Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Thu, 17 Nov 2022 16:57:10 -0800 Subject: [PATCH 04/11] precaution for empty ownedCommentIds coming in --- src/main/java/gov/nasa/jpl/mbee/mdk/emf/EMFImporter.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/emf/EMFImporter.java b/src/main/java/gov/nasa/jpl/mbee/mdk/emf/EMFImporter.java index 5106e7071..3720eb58f 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/emf/EMFImporter.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/emf/EMFImporter.java @@ -102,6 +102,11 @@ public static class PreProcessor { JsonNode jsonNode = objectNode.get(MDKConstants.DOCUMENTATION_KEY); if (jsonNode != null && jsonNode.isTextual()) { ModelHelper.setComment(element, jsonNode.asText()); + //prevent ownedCommentIds empty array from wiping out documentation later + if (objectNode.get(MDKConstants.OWNED_COMMENT_IDS_KEY) != null + && objectNode.get(MDKConstants.OWNED_COMMENT_IDS_KEY).isEmpty()) { + objectNode.remove(MDKConstants.OWNED_COMMENT_IDS_KEY); + } } return element; } From 3a220af6ce669dae992975df8e412dc2923ffd58 Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Mon, 28 Nov 2022 12:55:51 -0800 Subject: [PATCH 05/11] fix commit parsing --- .../mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java index 514705e9c..c7240828c 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java @@ -248,7 +248,7 @@ private void determineChangesUsingCommitResponse(File responseFile, Set if(commitObjects != null && !commitObjects.isEmpty()) { Map commitSizes = new HashMap<>(); for(ObjectNode jsonObject : commitObjects) { - if(jsonObject.isArray() && jsonObject.size() > 0) { + if(jsonObject.isObject() && jsonObject.size() > 0) { validateJsonElementArray(jsonObject, lockedElementIds, commitSizes); } if (MDUtils.isDeveloperMode()) { @@ -265,8 +265,8 @@ private void determineChangesUsingCommitResponse(File responseFile, Set } } - private void validateJsonElementArray(JsonNode arrayNode, Set lockedElementIds, Map sizes) { - JsonNode sourceField = arrayNode.get(MDKConstants.SOURCE_FIELD); + private void validateJsonElementArray(JsonNode objectNode, Set lockedElementIds, Map sizes) { + JsonNode sourceField = objectNode.get(MDKConstants.SOURCE_FIELD); String commitSyncDirection = ""; int size = 0; boolean isSyncingCommit = sourceField != null && sourceField.isTextual() && MDKConstants.MAGICDRAW_SOURCE_VALUE.equalsIgnoreCase(sourceField.asText()); @@ -279,7 +279,7 @@ private void validateJsonElementArray(JsonNode arrayNode, Set lockedElem size = sizes.get(commitSyncDirection); } for (Map.Entry entry : CHANGE_MAPPING.entrySet()) { - JsonNode changesJsonArray = arrayNode.get(entry.getKey()); + JsonNode changesJsonArray = objectNode.get(entry.getKey()); if (changesJsonArray == null || !changesJsonArray.isArray()) { throw new IllegalStateException(); } From 16569c7b03e4a99d162b34c6fd801d7cde06f700 Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Mon, 28 Nov 2022 17:43:03 -0800 Subject: [PATCH 06/11] fix getting commits in order --- .../nasa/jpl/mbee/mdk/json/JacksonUtils.java | 8 +++---- .../mdk/mms/actions/CommitBranchAction.java | 4 ++-- .../MMSDeltaProjectEventListenerAdapter.java | 24 +++++++------------ .../mdk/mms/validation/ElementValidator.java | 4 ++-- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/json/JacksonUtils.java b/src/main/java/gov/nasa/jpl/mbee/mdk/json/JacksonUtils.java index 9cb2f18aa..68abaf479 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/json/JacksonUtils.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/json/JacksonUtils.java @@ -122,9 +122,9 @@ public static ObjectNode parseJsonString(String string) throws IOException { return parseJsonObject(parser); } - public static Map> parseResponseIntoObjects(File responseFile, String expectedKey) throws IOException { + public static Map> parseResponseIntoObjects(File responseFile, String expectedKey) throws IOException { JsonToken current; - Map> parsedResponseObjects = new HashMap<>(); + Map> parsedResponseObjects = new HashMap<>(); try(JsonParser jsonParser = JacksonUtils.getJsonFactory().createParser(responseFile)) { current = (jsonParser.getCurrentToken() == null ? jsonParser.nextToken() : jsonParser.getCurrentToken()); if (current != JsonToken.START_OBJECT) { @@ -155,8 +155,8 @@ public static Map> parseResponseIntoObjects(File respons return parsedResponseObjects; } - private static Set parseExpectedArray(JsonParser jsonParser, JsonToken current) throws IOException { - Set parsedObjects = new HashSet<>(); + private static List parseExpectedArray(JsonParser jsonParser, JsonToken current) throws IOException { + List parsedObjects = new ArrayList<>(); if (current != null) { // assumes the calling method has begun initial parsing stages current = jsonParser.nextToken(); if(current.equals(JsonToken.START_ARRAY)) { diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/CommitBranchAction.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/CommitBranchAction.java index 3a5a3f12c..5cbbee3e1 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/CommitBranchAction.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/CommitBranchAction.java @@ -203,8 +203,8 @@ public void run(ProgressStatus progressStatus) { } private ObjectNode findParentBranch(File responseFile, String parentBranchId) throws IOException { - Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.REFS_NODE); - Set refObjects = parsedResponseObjects.get(MDKConstants.REFS_NODE); + Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.REFS_NODE); + List refObjects = parsedResponseObjects.get(MDKConstants.REFS_NODE); if(refObjects != null && !refObjects.isEmpty()) { for(ObjectNode refObjectNode : refObjects) { diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java index c7240828c..088de99fa 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java @@ -177,9 +177,8 @@ public synchronized boolean update() throws URISyntaxException, IOException, Ser return false; } Deque commitIdDeque = new ArrayDeque<>(); - int exponent = 0; - obtainAndParseCommits(commitIdDeque, exponent, project); + obtainAndParseCommits(commitIdDeque, project); if (commitIdDeque.isEmpty()) { return true; @@ -202,15 +201,10 @@ public synchronized boolean update() throws URISyntaxException, IOException, Ser return true; } - private void obtainAndParseCommits(Deque commitIdDeque, int exponent, Project project) + private void obtainAndParseCommits(Deque commitIdDeque, Project project) throws URISyntaxException, IOException, ServerException, GeneralSecurityException { - int limit = 1; - int size = 0; - - while(size < limit) { // setup so condition is true at least once, previously this was a do while loop - commitIdDeque.clear(); - limit = (int) Math.pow(10, exponent++); - + int limit = 100; // look at commits until it gets to lastSyncedCommitId + commitIdDeque.clear(); HashMap uriBuilderParams = new HashMap<>(); uriBuilderParams.put("limit", Integer.toString(limit)); HttpRequestBase commitsRequest = MMSUtils.prepareEndpointBuilderBasicGet(MMSCommitsEndpoint.builder(), project) @@ -219,8 +213,8 @@ private void obtainAndParseCommits(Deque commitIdDeque, int exponent, Pr .addParam(MMSEndpointBuilderConstants.URI_BUILDER_PARAMETERS, uriBuilderParams).build(); File responseFile = MMSUtils.sendMMSRequest(project, commitsRequest); - Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.COMMITS_NODE); - Set elementObjects = parsedResponseObjects.get(MDKConstants.COMMITS_NODE); + Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.COMMITS_NODE); + List elementObjects = parsedResponseObjects.get(MDKConstants.COMMITS_NODE); if(elementObjects != null && !elementObjects.isEmpty()) { for(ObjectNode jsonObject : elementObjects) { JsonNode idValue = jsonObject.get(MDKConstants.ID_KEY); @@ -234,16 +228,14 @@ private void obtainAndParseCommits(Deque commitIdDeque, int exponent, Pr } commitIdDeque.addFirst(id); } - size++; } } - } } private void determineChangesUsingCommitResponse(File responseFile, Set lockedElementIds, String commitId) throws IOException { // turns out the response still uses commits as the field of interest in terms of parsing - Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.COMMITS_NODE); - Set commitObjects = parsedResponseObjects.get(MDKConstants.COMMITS_NODE); + Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.COMMITS_NODE); + List commitObjects = parsedResponseObjects.get(MDKConstants.COMMITS_NODE); if(commitObjects != null && !commitObjects.isEmpty()) { Map commitSizes = new HashMap<>(); diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java index f45f988fc..ad6310d99 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java @@ -143,8 +143,8 @@ public void run(ProgressStatus progressStatus) { private void processServerElements(Map> clientElementMap, Map serverElementMap) throws IOException { // process the parsers against the lists, adding processed keys to processed sets in case of multiple returns for (File responseFile : serverElementFiles) { - Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.ELEMENTS_NODE); - Set elementObjects = parsedResponseObjects.get(MDKConstants.ELEMENTS_NODE); + Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.ELEMENTS_NODE); + Set elementObjects = new HashSet(parsedResponseObjects.get(MDKConstants.ELEMENTS_NODE)); if(elementObjects != null && !elementObjects.isEmpty()) { if(serverObjectsOnlyHasBins(elementObjects)) { // solves edge case where first model validation incorrectly removes bins from project From 38293c20d27897de2095c0cbd5c8cb2bf984f5c6 Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Mon, 28 Nov 2022 17:58:39 -0800 Subject: [PATCH 07/11] limit not needed --- .../mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java index 088de99fa..17b5018f0 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java @@ -203,10 +203,10 @@ public synchronized boolean update() throws URISyntaxException, IOException, Ser private void obtainAndParseCommits(Deque commitIdDeque, Project project) throws URISyntaxException, IOException, ServerException, GeneralSecurityException { - int limit = 100; // look at commits until it gets to lastSyncedCommitId + // look at commits until it gets to lastSyncedCommitId commitIdDeque.clear(); HashMap uriBuilderParams = new HashMap<>(); - uriBuilderParams.put("limit", Integer.toString(limit)); + //uriBuilderParams.put("limit", Integer.toString(limit)); HttpRequestBase commitsRequest = MMSUtils.prepareEndpointBuilderBasicGet(MMSCommitsEndpoint.builder(), project) .addParam(MMSEndpointBuilderConstants.URI_PROJECT_SUFFIX, Converters.getIProjectToIdConverter().apply(project.getPrimaryProject())) .addParam(MMSEndpointBuilderConstants.URI_REF_SUFFIX, MDUtils.getBranchId(project)) From 4feccf76d2b0683b2c39793cb75bcdf114a5d04b Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Tue, 29 Nov 2022 13:21:03 -0800 Subject: [PATCH 08/11] remove polling mms deltas --- .../mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java index 17b5018f0..46049a21b 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/mms/MMSDeltaProjectEventListenerAdapter.java @@ -43,13 +43,16 @@ public void projectOpened(Project project) { return; } projectClosed(project); + // no need to poll mms when it'll just do the whole thing at commit + /* getProjectMapping(project).setScheduledFuture(TaskRunner.scheduleWithProgressStatus(progressStatus -> { try { getProjectMapping(project).update(); } catch (URISyntaxException | IOException | ServerException | GeneralSecurityException e) { e.printStackTrace(); } - }, "MMS Fetch", false, TaskRunner.ThreadExecutionStrategy.POOLED, false, (r, ses) -> ses.scheduleAtFixedRate(r, 0, 1, TimeUnit.MINUTES))); + }, "MMS Fetch", false, TaskRunner.ThreadExecutionStrategy.POOLED, false, (r, ses) -> ses.scheduleAtFixedRate(r, 0, 60, TimeUnit.MINUTES))); + */ if (MDKProjectOptions.getMbeeEnabled(project)) { MMSLoginAction.loginAction(project); } From a6da6aa1d70bf28a9499577b53e10baddf167fe0 Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Tue, 29 Nov 2022 13:21:23 -0800 Subject: [PATCH 09/11] fix env options --- src/main/java/gov/nasa/jpl/mbee/mdk/MDKPluginHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/MDKPluginHelper.java b/src/main/java/gov/nasa/jpl/mbee/mdk/MDKPluginHelper.java index 43257d55f..c30b2c203 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/MDKPluginHelper.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/MDKPluginHelper.java @@ -65,7 +65,7 @@ public void init() { private void configureEnvironmentOptions() { EnvironmentOptions mdkOptions = Application.getInstance().getEnvironmentOptions(); - mdkOptions.addGroup(new MDKEnvironmentOptionsGroup()); + mdkOptions.addGroup(MDKEnvironmentOptionsGroup.getInstance()); } From 5b83f3c8f52a2a17a7885114d3b5f413a91b71ee Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Thu, 1 Dec 2022 10:12:35 -0800 Subject: [PATCH 10/11] fix lgtm --- .../nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java index ad6310d99..ff55c625f 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/validation/ElementValidator.java @@ -144,8 +144,9 @@ private void processServerElements(Map> client // process the parsers against the lists, adding processed keys to processed sets in case of multiple returns for (File responseFile : serverElementFiles) { Map> parsedResponseObjects = JacksonUtils.parseResponseIntoObjects(responseFile, MDKConstants.ELEMENTS_NODE); - Set elementObjects = new HashSet(parsedResponseObjects.get(MDKConstants.ELEMENTS_NODE)); - if(elementObjects != null && !elementObjects.isEmpty()) { + List elementObjectsList = parsedResponseObjects.get(MDKConstants.ELEMENTS_NODE); + if(elementObjectsList != null && !elementObjectsList.isEmpty()) { + Set elementObjects = new HashSet<>(elementObjectsList); if(serverObjectsOnlyHasBins(elementObjects)) { // solves edge case where first model validation incorrectly removes bins from project removeServerObjectNodeUsingIdPrefix(elementObjects, MDKConstants.HOLDING_BIN_ID_PREFIX); From bea310bfedf1a67e9d3630234049d246404fd1a2 Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Mon, 5 Dec 2022 11:55:57 -0800 Subject: [PATCH 11/11] update release --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index f2705bea8..e04e3e25b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=5.1.0 +version=5.1.1 group=org.openmbee.mdk.magic descriptorFile=MDR_Plugin_Model_Development_Kit_91110_descriptor.xml magicdDrawGroupName=gov.nasa.jpl.cae.magicdraw.mdk