From 24550a3e346d526569e6520707e400044d92ef4a Mon Sep 17 00:00:00 2001 From: David Estes Date: Wed, 16 Oct 2024 09:27:09 -0400 Subject: [PATCH] fixing bug with concurrent modification, resolves #79 --- README.md | 4 +++- build.gradle | 2 +- src/main/java/com/bertramlabs/plugins/hcl4j/HCLParser.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9c6f30f..6e6ffa9 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,14 @@ Using gradle one can include the hcl4j dependency like so: ```groovy dependencies { - compile "com.bertramlabs.plugins:hcl4j:0.9.1" + compile "com.bertramlabs.plugins:hcl4j:0.9.4" } ``` ## What's New +* **0.9.4** Fixing concurrent modification exception on data lookup +* **0.9.3** Added missing methods for array manipulation such as flatten and try * **0.9.1** Remove annoying Nested Map Debug Log * **0.9.0** HCL Tuple for loop nested improvements. String escapes fixed. anytrue and alltrue methods added. * **0.8.0** HCL For Loop Tuples now evaluated. diff --git a/build.gradle b/build.gradle index 20b4e83..0750434 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ ext { group = 'com.bertramlabs.plugins' -version = '0.9.3' +version = '0.9.4' ext.isReleaseVersion = !version.endsWith("SNAPSHOT") sourceCompatibility = "1.8" diff --git a/src/main/java/com/bertramlabs/plugins/hcl4j/HCLParser.java b/src/main/java/com/bertramlabs/plugins/hcl4j/HCLParser.java index b572be3..11600bd 100644 --- a/src/main/java/com/bertramlabs/plugins/hcl4j/HCLParser.java +++ b/src/main/java/com/bertramlabs/plugins/hcl4j/HCLParser.java @@ -335,7 +335,7 @@ public Map parse(Reader reader, Boolean ignoreParserExceptions) intermediateHclParserExceptionHandling(() -> processSymbolPass2(result.get("data"), result), ignoreParserExceptions); } - for (String key : result.keySet()) { + for (String key : result.keySet().toArray(new String[0])) { intermediateHclParserExceptionHandling(() -> { if (!Objects.equals(key, "variable") && !Objects.equals(key, "data") && !Objects.equals(key, "locals")) { processSymbolPass2(result.get(key), result);