From 89f29391028eeb8f7f701343a07f9a3ff2e2e95e Mon Sep 17 00:00:00 2001 From: Antonio Date: Tue, 24 Feb 2026 21:00:15 +0100 Subject: [PATCH] 13.5.1-SNAPSHOT - TOML v1.1 - Set version to 13.5.1 - Restore JDK8 class format --- README.md | 14 +++++++++----- pom.xml | 4 ++-- src/main/java/net/vieiro/toml/TOMLSimpleQuery.java | 2 +- .../java/net/vieiro/toml/TOMLSimpleQueryTest.java | 6 +++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 351a684..7c85919 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ A parser for [TOML](https://toml.io/en/) files with minimum dependencies. ## Maven & Gradle coordinates -- Current version: 13.4.2 +- Current version: 13.5.1 - 13 - Dependency on Antlr 4.13.1 - - 4 - TOML grammar version 4 - - 2 - Release 2 + - 5 - TOML grammar version 5 (supports TOML 1.1 specification) + - 1 - Release 1 Maven: @@ -23,14 +23,14 @@ Maven: net.vieiro toml-java - 13.4.2 + 13.5.1 ``` Gradle: ```groovy -implementation 'net.vieiro:toml-java:13.4.2' +implementation 'net.vieiro:toml-java:13.5.1' ``` ## Basic usage @@ -232,3 +232,7 @@ This version depends on Antlr4 v4.11.1 (changed to adhere to NetBeans Antlr4 ver - Handling of unclosed inline-tables and arrays with invalid tokens for NetBeans. +## 13.5.1 + +- Support TOML v1.1 + diff --git a/pom.xml b/pom.xml index 6e1829c..150387d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.vieiro toml-java - 13.4.3-SNAPSHOT + 13.5.1-SNAPSHOT jar toml-java @@ -81,7 +81,6 @@ UTF-8 4.13.1 - 11 @@ -193,6 +192,7 @@ 3.14.1 -Xlint:unchecked + 8 diff --git a/src/main/java/net/vieiro/toml/TOMLSimpleQuery.java b/src/main/java/net/vieiro/toml/TOMLSimpleQuery.java index a868555..b05a083 100644 --- a/src/main/java/net/vieiro/toml/TOMLSimpleQuery.java +++ b/src/main/java/net/vieiro/toml/TOMLSimpleQuery.java @@ -32,7 +32,7 @@ static Optional get(Map root, String path, Class clazz Object context = root; for (int i = 0; i < parts.length; i++) { String part = parts[i]; - if (part.isBlank()) { + if (part.trim().isEmpty()) { continue; } if (context instanceof Map) { diff --git a/src/test/java/net/vieiro/toml/TOMLSimpleQueryTest.java b/src/test/java/net/vieiro/toml/TOMLSimpleQueryTest.java index b797328..74a4928 100644 --- a/src/test/java/net/vieiro/toml/TOMLSimpleQueryTest.java +++ b/src/test/java/net/vieiro/toml/TOMLSimpleQueryTest.java @@ -30,17 +30,17 @@ public void testShouldSimpleQueryIgnoreDifferentSlashes() throws Exception { TOML toml = Util.parse("array-of-tables-test.toml", verbose); // When we query something starting with a single "/" - String red = toml.getString("/fruit/apple/color").orElseThrow(); + String red = toml.getString("/fruit/apple/color").orElseThrow(() -> new IllegalStateException("/fruit/apple/color")); // Then we get the proper value Assertions.assertEquals("red", red); // When we remove the leading "/" - red = toml.getString("fruit/apple/color").orElseThrow(); + red = toml.getString("fruit/apple/color").orElseThrow(() -> new IllegalStateException("fruit/apple/color")); // Then the value is also correct Assertions.assertEquals("red", red); // When we add different contigous slashes - red = toml.getString("fruit///apple/color").orElseThrow(); + red = toml.getString("fruit///apple/color").orElseThrow( () -> new IllegalStateException("fruit///apple/color")); // Then the value is also correct Assertions.assertEquals("red", red);