From 85b7bcc260915d19ef7b9f7b8dafa0f61cc586ff Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Wed, 11 Dec 2024 04:45:03 +0200 Subject: [PATCH 01/17] Improved attribute parser to handle values with equal signs --- src/main/java/com/github/underscore/Xml.java | 36 +++++----- .../com/github/underscore/LodashTest.java | 13 ++++ .../com/github/underscore/StringTest.java | 66 ++++++++++++++++++- 3 files changed, 93 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/github/underscore/Xml.java b/src/main/java/com/github/underscore/Xml.java index 122f5d4b..3ed2173a 100644 --- a/src/main/java/com/github/underscore/Xml.java +++ b/src/main/java/com/github/underscore/Xml.java @@ -1521,30 +1521,26 @@ private static Object addElement( } static Map parseAttributes(final String source) { - final Map result = new LinkedHashMap<>(); - final StringBuilder key = new StringBuilder(); - final StringBuilder value = new StringBuilder(); - boolean quoteFound = false; - boolean equalFound = false; - for (int index = 0; index < source.length(); index += 1) { - if (source.charAt(index) == '=') { - equalFound = !equalFound; - continue; - } - if (source.charAt(index) == '"') { - if (quoteFound && equalFound) { + Map result = new LinkedHashMap<>(); + StringBuilder key = new StringBuilder(); + StringBuilder value = new StringBuilder(); + boolean inQuotes = false; + boolean expectingValue = false; + for (char c : source.toCharArray()) { + if (c == '"') { + inQuotes = !inQuotes; + if (!inQuotes && expectingValue) { result.put(key.toString(), value.toString()); key.setLength(0); value.setLength(0); - equalFound = false; - } - quoteFound = !quoteFound; - } else if (quoteFound || SKIPPED_CHARS.contains(source.charAt(index))) { - if (quoteFound) { - value.append(source.charAt(index)); + expectingValue = false; } - } else { - key.append(source.charAt(index)); + } else if (c == '=' && !inQuotes) { + expectingValue = true; + } else if (inQuotes) { + value.append(c); + } else if (!SKIPPED_CHARS.contains(c)) { + key.append(c); } } return result; diff --git a/src/test/java/com/github/underscore/LodashTest.java b/src/test/java/com/github/underscore/LodashTest.java index 21085f41..837f0377 100644 --- a/src/test/java/com/github/underscore/LodashTest.java +++ b/src/test/java/com/github/underscore/LodashTest.java @@ -1028,6 +1028,19 @@ void xmpToJson4() { + "")); } + @Test + void xmpToJson5() { + assertEquals("{\n" + + " \"Comment\": {\n" + + " \"-stringValue\": \"============================\",\n" + + " \"-self-closing\": \"true\"\n" + + " },\n" + + " \"#omit-xml-declaration\": \"yes\"\n" + + "}", + U.xmlToJson( + "")); + } + @Test void xmlToJsonMinimum() { assertEquals( diff --git a/src/test/java/com/github/underscore/StringTest.java b/src/test/java/com/github/underscore/StringTest.java index 8b083b72..692f3891 100644 --- a/src/test/java/com/github/underscore/StringTest.java +++ b/src/test/java/com/github/underscore/StringTest.java @@ -2358,9 +2358,71 @@ void parseAttributes() { "{version=1.0}", Xml.parseAttributes(" version = \"1.0\" encoding= \"UTF-8 ").toString()); assertEquals( - "{}", Xml.parseAttributes(" version = \"1.0 encoding= \"UTF-8\" ").toString()); + "{version=1.0 encoding= }", + Xml.parseAttributes(" version = \"1.0 encoding= \"UTF-8\" ").toString()); assertEquals( - "{}", Xml.parseAttributes(" version = 1.0\" encoding= \"UTF-8\" ").toString()); + "{version1.0= encoding= }", + Xml.parseAttributes(" version = 1.0\" encoding= \"UTF-8\" ").toString()); + } + + @Test + void testSingleAttribute() { + Map result = Xml.parseAttributes("key1=\"value1\""); + assertEquals(Map.of("key1", "value1"), result); + } + + @Test + void testMultipleAttributes() { + Map result = Xml.parseAttributes("key1=\"value1\" key2=\"value2\""); + assertEquals(Map.of("key1", "value1", "key2", "value2"), result); + } + + @Test + void testAttributeWithSpaces() { + Map result = Xml.parseAttributes("key1=\"value with spaces\" key2=\"another value\""); + assertEquals(Map.of("key1", "value with spaces", "key2", "another value"), result); + } + + @Test + void testEmptyValue() { + Map result = Xml.parseAttributes("key1=\"value1\" key2=\"\""); + assertEquals(Map.of("key1", "value1", "key2", ""), result); + } + + @Test + void testAttributesWithoutSpaceSeparation() { + Map result = Xml.parseAttributes("key1=\"value1\"key2=\"value2\""); + assertEquals(Map.of("key1", "value1", "key2", "value2"), result); + } + + @Test + void testUnclosedQuotes() { + Map result = Xml.parseAttributes("key1=\"value1 key2=\"value2\""); + assertEquals(Map.of("key1", "value1 key2="), result); + } + + @Test + void testEqualsSignInValue() { + Map result = Xml.parseAttributes("key1=\"value=1\" key2=\"value=2\""); + assertEquals(Map.of("key1", "value=1", "key2", "value=2"), result); + } + + @Test + void testTrailingWhitespace() { + Map result = Xml.parseAttributes("key1=\"value1\" key2=\"value2\" "); + assertEquals(Map.of("key1", "value1", "key2", "value2"), result); + } + + @Test + void testLeadingWhitespace() { + Map result = Xml.parseAttributes(" key1=\"value1\" key2=\"value2\""); + assertEquals(Map.of("key1", "value1", "key2", "value2"), result); + } + + @Test + void testNoEqualsSign() { + Map result = Xml.parseAttributes("key1\"value1\" key2=\"value2\""); + assertEquals(Map.of("key1key2", "value1value2"), result); } @SuppressWarnings("unchecked") From 9282c4d7c720349c29c0cdb4b89ebe1975fc2b78 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Wed, 11 Dec 2024 09:44:56 +0200 Subject: [PATCH 02/17] Version 1.109 --- README.md | 6 +++--- pom-central.xml | 2 +- pom-pack.xml | 2 +- pom.xml | 2 +- src/test/java/com/github/underscore/FunctionsTest.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 796038e8..4e507d40 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ underscore-java =============== -[![Maven Central](https://img.shields.io/maven-central/v/com.github.javadev/underscore.svg)](https://central.sonatype.com/artifact/com.github.javadev/underscore/1.108) +[![Maven Central](https://img.shields.io/maven-central/v/com.github.javadev/underscore.svg)](https://central.sonatype.com/artifact/com.github.javadev/underscore/1.109) [![MIT License](http://img.shields.io/badge/license-MIT-green.svg)](https://github.com/javadev/underscore-java/blob/main/LICENSE) [![Java CI](https://github.com/javadev/underscore-java/actions/workflows/maven.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/maven.yml) [![CodeQL](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml) @@ -43,7 +43,7 @@ To configure your Maven project, add the following code to your pom.xml file: com.github.javadev underscore - 1.108 + 1.109 ... @@ -52,7 +52,7 @@ To configure your Maven project, add the following code to your pom.xml file: Gradle configuration: ```groovy -implementation 'com.github.javadev:underscore:1.108' +implementation 'com.github.javadev:underscore:1.109' ``` ### Usage diff --git a/pom-central.xml b/pom-central.xml index 7ae7e995..c2fb53db 100644 --- a/pom-central.xml +++ b/pom-central.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.108 + 1.109 java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java diff --git a/pom-pack.xml b/pom-pack.xml index a8f2ae8d..ee0f6ddd 100644 --- a/pom-pack.xml +++ b/pom-pack.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.108 + 1.109 java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java diff --git a/pom.xml b/pom.xml index 081c0494..336dc2ca 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.108-SNAPSHOT + 1.109-SNAPSHOT java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java diff --git a/src/test/java/com/github/underscore/FunctionsTest.java b/src/test/java/com/github/underscore/FunctionsTest.java index 4eb7b642..60206d55 100644 --- a/src/test/java/com/github/underscore/FunctionsTest.java +++ b/src/test/java/com/github/underscore/FunctionsTest.java @@ -199,7 +199,7 @@ void defer() { return null; }); assertEquals(0, counter[0].intValue(), "incr was debounced"); - await().atLeast(90, TimeUnit.MILLISECONDS) + await().atMost(120, TimeUnit.MILLISECONDS) .until( () -> { assertEquals(1, counter[0].intValue(), "incr was debounced"); From b86d4e131e1af052791c77951643ce54ad6b30da Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Fri, 20 Dec 2024 12:00:12 +0200 Subject: [PATCH 03/17] Fixed sonar warnings --- src/test/java/com/github/underscore/LodashTest.java | 5 ++--- src/test/java/com/github/underscore/ObjectsTest.java | 4 ++-- src/test/java/com/github/underscore/UnderscoreTest.java | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/github/underscore/LodashTest.java b/src/test/java/com/github/underscore/LodashTest.java index 837f0377..7a47cb4c 100644 --- a/src/test/java/com/github/underscore/LodashTest.java +++ b/src/test/java/com/github/underscore/LodashTest.java @@ -413,8 +413,7 @@ void set() { U.set( (Map) U.fromJson("{\"a\":[{\"b\":{\"c\":\"d\"}}]}"), "a[0].b.c", - "e") - .toString()); + "e")); assertEquals( "{b={c=d}}", U.set( @@ -428,7 +427,7 @@ void set() { map.put("a", map2); map2.put("#item", map3); map3.put("b", "c"); - assertEquals("c", U.set(map, "a.b", "b").toString()); + assertEquals("c", U.set(map, "a.b", "b")); assertNull(U.set((Map) null, "a", "b")); assertNull(U.set(new LinkedHashMap(), "a.b", "b")); Map map4 = new LinkedHashMap<>(); diff --git a/src/test/java/com/github/underscore/ObjectsTest.java b/src/test/java/com/github/underscore/ObjectsTest.java index 69f380c3..9cc8174f 100644 --- a/src/test/java/com/github/underscore/ObjectsTest.java +++ b/src/test/java/com/github/underscore/ObjectsTest.java @@ -174,7 +174,7 @@ void pick() { put("userid", "moe1"); } }, - value -> value instanceof Number); + Number.class::isInstance); assertEquals("[age=50]", result2.toString()); } @@ -208,7 +208,7 @@ void omit() { put("userid", "moe1"); } }, - value -> value instanceof Number); + Number.class::isInstance); assertEquals("[name=moe, userid=moe1]", result2.toString()); } diff --git a/src/test/java/com/github/underscore/UnderscoreTest.java b/src/test/java/com/github/underscore/UnderscoreTest.java index c3bc1f83..2d8b32a5 100644 --- a/src/test/java/com/github/underscore/UnderscoreTest.java +++ b/src/test/java/com/github/underscore/UnderscoreTest.java @@ -166,9 +166,9 @@ void push() { @SuppressWarnings("unchecked") @Test void pop() { - assertEquals("c", Underscore.pop(asList("a", "b", "c")).getKey().toString()); + assertEquals("c", Underscore.pop(asList("a", "b", "c")).getKey()); assertEquals("c", new Underscore(asList("a", "b", "c")).pop().getKey().toString()); - assertEquals("c", Underscore.chain(asList("a", "b", "c")).pop().item().getKey().toString()); + assertEquals("c", Underscore.chain(asList("a", "b", "c")).pop().item().getKey()); } /* @@ -178,7 +178,7 @@ void pop() { @SuppressWarnings("unchecked") @Test void shift() { - assertEquals("a", Underscore.shift(asList("a", "b", "c")).getKey().toString()); + assertEquals("a", Underscore.shift(asList("a", "b", "c")).getKey()); assertEquals("a", new Underscore(asList("a", "b", "c")).shift().getKey().toString()); assertEquals( "a", Underscore.chain(asList("a", "b", "c")).shift().item().getKey().toString()); @@ -541,7 +541,7 @@ void optional() { assertEquals("1", Optional.of(1).orElse(null).toString()); assertFalse(Optional.empty().map(arg -> "" + arg).isPresent()); assertTrue(Optional.empty().map(arg -> "" + arg).isEmpty()); - assertEquals("1", Optional.of(1).map(arg -> "" + arg).get().toString()); + assertEquals("1", Optional.of(1).map(arg -> "" + arg).get()); try { Optional.empty().get(); fail("IllegalStateException expected"); From dbb01e1acc7f47b80b61316c288efcda7d93e5b6 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 30 Dec 2024 00:22:39 +0200 Subject: [PATCH 04/17] Spring boot 3.4.1 --- spring-boot-example/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-example/pom.xml b/spring-boot-example/pom.xml index b553b32b..91c3d91c 100644 --- a/spring-boot-example/pom.xml +++ b/spring-boot-example/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.0 + 3.4.1 com.example From 605112c2e565e3d89eccf64d180b2c2989ff0350 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 30 Dec 2024 03:05:25 +0200 Subject: [PATCH 05/17] Fixed Sonar warning --- src/test/java/com/github/underscore/UnderscoreTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/java/com/github/underscore/UnderscoreTest.java b/src/test/java/com/github/underscore/UnderscoreTest.java index 2d8b32a5..09952755 100644 --- a/src/test/java/com/github/underscore/UnderscoreTest.java +++ b/src/test/java/com/github/underscore/UnderscoreTest.java @@ -180,8 +180,7 @@ void pop() { void shift() { assertEquals("a", Underscore.shift(asList("a", "b", "c")).getKey()); assertEquals("a", new Underscore(asList("a", "b", "c")).shift().getKey().toString()); - assertEquals( - "a", Underscore.chain(asList("a", "b", "c")).shift().item().getKey().toString()); + assertEquals("a", Underscore.chain(asList("a", "b", "c")).shift().item().getKey()); } /* From 84897e6cdf7881485b3f739406e27a1dcfe170c8 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Sun, 5 Jan 2025 12:45:18 +0200 Subject: [PATCH 06/17] Fixed Sonar warnings --- .../github/underscore/CollectionsTest.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/test/java/com/github/underscore/CollectionsTest.java b/src/test/java/com/github/underscore/CollectionsTest.java index 3daeb825..3fe01ef5 100644 --- a/src/test/java/com/github/underscore/CollectionsTest.java +++ b/src/test/java/com/github/underscore/CollectionsTest.java @@ -1301,26 +1301,25 @@ void sortWith() { Underscore.sortWith( asList(1, 2, 3, 4, 5, 6), (item1, item2) -> - Double.valueOf(Math.sin(item1) * 1000).intValue() - - Double.valueOf(Math.sin(item2) * 1000).intValue()); + (int) (Math.sin(item1) * 1000) + - (int) (Math.sin(item2) * 1000)); assertEquals("[5, 4, 6, 3, 1, 2]", result.toString()); final List resultObj = new Underscore(asList(1, 2, 3, 4, 5, 6)) .sortWith( (Comparator) (item1, item2) -> - Double.valueOf(Math.sin(item1) * 1000).intValue() - - Double.valueOf(Math.sin(item2) * 1000) - .intValue()); + (int) (Math.sin(item1) * 1000) + - (int) (Math.sin(item2) * 1000)); assertEquals("[5, 4, 6, 3, 1, 2]", resultObj.toString()); final List resultChain = Underscore.chain(asList(1, 2, 3, 4, 5, 6)) .sortWith( (Comparator) (item1, item2) -> - Double.valueOf(Math.sin(item1) * 1000).intValue() - - Double.valueOf(Math.sin(item2) * 1000) - .intValue()) + (int) (Math.sin(item1) * 1000) + - (int) (Math.sin(item2) * 1000) + ) .value(); assertEquals("[5, 4, 6, 3, 1, 2]", resultChain.toString()); } @@ -1335,17 +1334,17 @@ void sortBy() { final List result = Underscore.sortBy( asList(1, 2, 3, 4, 5, 6), - item -> Double.valueOf(Math.sin(item) * 1000).intValue()); + item -> (int) (Math.sin(item) * 1000)); assertEquals("[5, 4, 6, 3, 1, 2]", result.toString()); final List resultObj = new Underscore(asList(1, 2, 3, 4, 5, 6)) .sortBy( (Function) - item -> Double.valueOf(Math.sin(item) * 1000).intValue()); + item -> (int) (Math.sin(item) * 1000)); assertEquals("[5, 4, 6, 3, 1, 2]", resultObj.toString()); final List resultChain = Underscore.chain(asList(1, 2, 3, 4, 5, 6)) - .sortBy(item -> Double.valueOf(Math.sin(item) * 1000).intValue()) + .sortBy(item -> (int) (Math.sin(item) * 1000)) .value(); assertEquals("[5, 4, 6, 3, 1, 2]", resultChain.toString()); } From 6b1629e17d3c0370a7dc7a08fa989794755031f5 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Thu, 23 Jan 2025 09:37:35 +0200 Subject: [PATCH 07/17] Version 1.110 --- README.md | 6 +++--- pom-central.xml | 2 +- pom-pack.xml | 2 +- pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4e507d40..8b8cada4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ underscore-java =============== -[![Maven Central](https://img.shields.io/maven-central/v/com.github.javadev/underscore.svg)](https://central.sonatype.com/artifact/com.github.javadev/underscore/1.109) +[![Maven Central](https://img.shields.io/maven-central/v/com.github.javadev/underscore.svg)](https://central.sonatype.com/artifact/com.github.javadev/underscore/1.110) [![MIT License](http://img.shields.io/badge/license-MIT-green.svg)](https://github.com/javadev/underscore-java/blob/main/LICENSE) [![Java CI](https://github.com/javadev/underscore-java/actions/workflows/maven.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/maven.yml) [![CodeQL](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml) @@ -43,7 +43,7 @@ To configure your Maven project, add the following code to your pom.xml file: com.github.javadev underscore - 1.109 + 1.110 ... @@ -52,7 +52,7 @@ To configure your Maven project, add the following code to your pom.xml file: Gradle configuration: ```groovy -implementation 'com.github.javadev:underscore:1.109' +implementation 'com.github.javadev:underscore:1.110' ``` ### Usage diff --git a/pom-central.xml b/pom-central.xml index c2fb53db..3ca582d4 100644 --- a/pom-central.xml +++ b/pom-central.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.109 + 1.110 java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java diff --git a/pom-pack.xml b/pom-pack.xml index ee0f6ddd..b9ab6314 100644 --- a/pom-pack.xml +++ b/pom-pack.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.109 + 1.110 java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java diff --git a/pom.xml b/pom.xml index 336dc2ca..0ec9a982 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.109-SNAPSHOT + 1.110-SNAPSHOT java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java From df7aca8051793e5652786b00c19aaae9771bfeaa Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Tue, 4 Feb 2025 13:51:36 +0200 Subject: [PATCH 08/17] Delete .github/workflows/scorecard.yml --- .github/workflows/scorecard.yml | 73 --------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml deleted file mode 100644 index dc2cfbb9..00000000 --- a/.github/workflows/scorecard.yml +++ /dev/null @@ -1,73 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. They are provided -# by a third-party and are governed by separate terms of service, privacy -# policy, and support documentation. - -name: Scorecard supply-chain security -on: - # For Branch-Protection check. Only the default branch is supported. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection - branch_protection_rule: - # To guarantee Maintained check is occasionally updated. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained - schedule: - - cron: '22 11 * * 2' - push: - branches: [ "main" ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecard analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Needed to publish results and get a badge (see publish_results below). - id-token: write - # Uncomment the permissions below if installing in a private repository. - # contents: read - # actions: read - - steps: - - name: "Checkout code" - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 - with: - results_file: results.sarif - results_format: sarif - # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: - # - you want to enable the Branch-Protection check on a *public* repository, or - # - you are installing Scorecard on a *private* repository - # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. - # repo_token: ${{ secrets.SCORECARD_TOKEN }} - - # Public repositories: - # - Publish results to OpenSSF REST API for easy access by consumers - # - Allows the repository to include the Scorecard badge. - # - See https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories: - # - `publish_results` will always be set to `false`, regardless - # of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF - # format to the repository Actions tab. - - name: "Upload artifact" - uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard (optional). - # Commenting out will disable upload of results to your repo's Code Scanning dashboard - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 - with: - sarif_file: results.sarif From bef757c8b04b9f77c0072c77a31a5e3dcb20cedd Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Tue, 4 Feb 2025 14:04:51 +0200 Subject: [PATCH 09/17] Created scorecard.yml --- .github/workflows/scorecard.yml | 73 +++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 00000000..a469125f --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,73 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '35 14 * * 6' + push: + branches: [ "main" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecard on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard (optional). + # Commenting out will disable upload of results to your repo's Code Scanning dashboard + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: results.sarif From 56dbd6604d0c3b7830f03cfafaa1c603e361d8a4 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Fri, 7 Feb 2025 09:23:16 +0200 Subject: [PATCH 10/17] Delete .github/workflows/scorecard.yml --- .github/workflows/scorecard.yml | 73 --------------------------------- README.md | 1 - 2 files changed, 74 deletions(-) delete mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml deleted file mode 100644 index a469125f..00000000 --- a/.github/workflows/scorecard.yml +++ /dev/null @@ -1,73 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. They are provided -# by a third-party and are governed by separate terms of service, privacy -# policy, and support documentation. - -name: Scorecard supply-chain security -on: - # For Branch-Protection check. Only the default branch is supported. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection - branch_protection_rule: - # To guarantee Maintained check is occasionally updated. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained - schedule: - - cron: '35 14 * * 6' - push: - branches: [ "main" ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecard analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Needed to publish results and get a badge (see publish_results below). - id-token: write - # Uncomment the permissions below if installing in a private repository. - # contents: read - # actions: read - - steps: - - name: "Checkout code" - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 - with: - results_file: results.sarif - results_format: sarif - # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: - # - you want to enable the Branch-Protection check on a *public* repository, or - # - you are installing Scorecard on a *private* repository - # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. - # repo_token: ${{ secrets.SCORECARD_TOKEN }} - - # Public repositories: - # - Publish results to OpenSSF REST API for easy access by consumers - # - Allows the repository to include the Scorecard badge. - # - See https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories: - # - `publish_results` will always be set to `false`, regardless - # of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF - # format to the repository Actions tab. - - name: "Upload artifact" - uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard (optional). - # Commenting out will disable upload of results to your repo's Code Scanning dashboard - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif diff --git a/README.md b/README.md index 8b8cada4..94a88d2e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ underscore-java [![Java CI](https://github.com/javadev/underscore-java/actions/workflows/maven.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/maven.yml) [![CodeQL](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml) [![Semgrep](https://github.com/javadev/underscore-java/actions/workflows/semgrep.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/semgrep.yml) -[![Scorecard supply-chain security](https://github.com/javadev/underscore-java/actions/workflows/scorecard.yml/badge.svg?branch=main)](https://github.com/javadev/underscore-java/actions/workflows/scorecard.yml) [![OSSAR](https://github.com/javadev/underscore-java/actions/workflows/ossar.yml/badge.svg?branch=main)](https://github.com/javadev/underscore-java/actions/workflows/ossar.yml) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7019/badge)](https://bestpractices.coreinfrastructure.org/projects/7019) [![Coverage Status](https://coveralls.io/repos/javadev/underscore-java/badge.svg?branch=main)](https://coveralls.io/r/javadev/underscore-java) From 8f71521f515f17f1f28df81b4341f333bb7ac3ab Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Sat, 8 Feb 2025 07:09:44 +0200 Subject: [PATCH 11/17] Created scorecard.yml --- .github/workflows/scorecard.yml | 72 +++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 00000000..b5f7d4a3 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,72 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '22 18 * * 6' + push: + branches: [ "main" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecard on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@v4.6.0 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 + with: + sarif_file: results.sarif diff --git a/README.md b/README.md index 94a88d2e..8b8cada4 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ underscore-java [![Java CI](https://github.com/javadev/underscore-java/actions/workflows/maven.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/maven.yml) [![CodeQL](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml) [![Semgrep](https://github.com/javadev/underscore-java/actions/workflows/semgrep.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/semgrep.yml) +[![Scorecard supply-chain security](https://github.com/javadev/underscore-java/actions/workflows/scorecard.yml/badge.svg?branch=main)](https://github.com/javadev/underscore-java/actions/workflows/scorecard.yml) [![OSSAR](https://github.com/javadev/underscore-java/actions/workflows/ossar.yml/badge.svg?branch=main)](https://github.com/javadev/underscore-java/actions/workflows/ossar.yml) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7019/badge)](https://bestpractices.coreinfrastructure.org/projects/7019) [![Coverage Status](https://coveralls.io/repos/javadev/underscore-java/badge.svg?branch=main)](https://coveralls.io/r/javadev/underscore-java) From af3f470db80a434fe6274e7b804a89d849857144 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Sun, 9 Feb 2025 07:05:49 +0200 Subject: [PATCH 12/17] Updated LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 8ee7fdab..647e9deb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2015-2024 Valentyn Kolesnikov +Copyright (c) 2015-2025 Valentyn Kolesnikov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 714265e6a3d810370d758e73d704eb1b17727259 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Thu, 13 Feb 2025 08:14:13 +0200 Subject: [PATCH 13/17] Improved source format --- src/main/java/com/github/underscore/Json.java | 4 +- src/main/java/com/github/underscore/U.java | 33 +++--- .../com/github/underscore/Underscore.java | 20 ++-- src/main/java/com/github/underscore/Xml.java | 17 +-- .../com/github/underscore/ArraysTest.java | 3 +- .../github/underscore/CollectionsTest.java | 17 +-- .../com/github/underscore/LodashTest.java | 100 +++++++++--------- .../com/github/underscore/StringTest.java | 48 +++------ .../com/github/underscore/UnderscoreTest.java | 48 +++++---- .../com/github/underscore/UtilityTest.java | 6 +- 10 files changed, 143 insertions(+), 153 deletions(-) diff --git a/src/main/java/com/github/underscore/Json.java b/src/main/java/com/github/underscore/Json.java index 7f220dc6..1a054d09 100644 --- a/src/main/java/com/github/underscore/Json.java +++ b/src/main/java/com/github/underscore/Json.java @@ -83,7 +83,9 @@ public JsonStringBuilder append(final String string) { } public JsonStringBuilder fillSpaces() { - builder.append(String.valueOf(identStep == Step.TABS ? '\t' : ' ').repeat(Math.max(0, indent))); + builder.append( + String.valueOf(identStep == Step.TABS ? '\t' : ' ') + .repeat(Math.max(0, indent))); return this; } diff --git a/src/main/java/com/github/underscore/U.java b/src/main/java/com/github/underscore/U.java index c338e237..0e868f92 100644 --- a/src/main/java/com/github/underscore/U.java +++ b/src/main/java/com/github/underscore/U.java @@ -98,16 +98,7 @@ public class U extends Underscore { private static final String YES = "yes"; private static final java.util.regex.Pattern RE_WORDS = java.util.regex.Pattern.compile( - UPPER - + "+(?=" - + UPPER - + LOWER - + ")|" - + UPPER - + "?" - + LOWER - + "|" - + UPPER + UPPER + "+(?=" + UPPER + LOWER + ")|" + UPPER + "?" + LOWER + "|" + UPPER + "+|\\d+"); static { @@ -2069,8 +2060,7 @@ public static long downloadUrl(final String url, final String fileName) public static void decompressGzip(final String sourceFileName, final String targetFileName) throws IOException { - try (GZIPInputStream gis = - new GZIPInputStream(new FileInputStream(sourceFileName))) { + try (GZIPInputStream gis = new GZIPInputStream(new FileInputStream(sourceFileName))) { Files.copy(gis, Paths.get(targetFileName)); } } @@ -2524,12 +2514,16 @@ public static String join(final Iterable iterable, final String separator return Underscore.join(iterable, separator); } - public static String joinToString(final Iterable iterable, final String separator, - final String prefix, final String postfix, - final int limit, - final String truncated, - final Function transform) { - return Underscore.joinToString(iterable, separator, prefix, postfix, limit, truncated, transform); + public static String joinToString( + final Iterable iterable, + final String separator, + final String prefix, + final String postfix, + final int limit, + final String truncated, + final Function transform) { + return Underscore.joinToString( + iterable, separator, prefix, postfix, limit, truncated, transform); } public static String toJson(Collection collection) { @@ -2914,8 +2908,7 @@ public static Map removeMinusesAndConvertNumbers(Map java.util.concurrent.ScheduledFuture delay( java.util.concurrent.Executors.newSingleThreadScheduledExecutor(); try { return scheduler.schedule( - function::get, - delayMilliseconds, - java.util.concurrent.TimeUnit.MILLISECONDS); + function::get, delayMilliseconds, java.util.concurrent.TimeUnit.MILLISECONDS); } finally { scheduler.shutdown(); } @@ -3319,11 +3317,14 @@ public static String join(final Iterable iterable, final String separator return sb.toString(); } - public static String joinToString(final Iterable iterable, final String separator, - final String prefix, final String postfix, - final int limit, - final String truncated, - final Function transform) { + public static String joinToString( + final Iterable iterable, + final String separator, + final String prefix, + final String postfix, + final int limit, + final String truncated, + final Function transform) { final StringBuilder sb = new StringBuilder(); int index = 0; if (prefix != null) { @@ -3344,7 +3345,8 @@ public static String joinToString(final Iterable iterable, final String s return sb.toString(); } - private static void joinToStringPostfix(String postfix, int limit, String truncated, int index, StringBuilder sb) { + private static void joinToStringPostfix( + String postfix, int limit, String truncated, int index, StringBuilder sb) { if (limit >= 0 && index > limit) { sb.append(truncated == null ? "..." : truncated); } diff --git a/src/main/java/com/github/underscore/Xml.java b/src/main/java/com/github/underscore/Xml.java index 3ed2173a..0770a0cc 100644 --- a/src/main/java/com/github/underscore/Xml.java +++ b/src/main/java/com/github/underscore/Xml.java @@ -38,7 +38,14 @@ import java.util.function.BiFunction; import java.util.function.Function; -@SuppressWarnings({"java:S107", "java:S1119", "java:S2583", "java:S3740", "java:S3776", "java:S4276"}) +@SuppressWarnings({ + "java:S107", + "java:S1119", + "java:S2583", + "java:S3740", + "java:S3776", + "java:S4276" +}) public final class Xml { private Xml() {} @@ -1887,15 +1894,13 @@ public static Object fromXmlWithoutNamespaces(final String xml) { (object, namespaces) -> { final String localString = String.valueOf(object); final String result; - String substring = localString.substring( - Math.max(0, localString.indexOf(':') + 1)); + String substring = + localString.substring(Math.max(0, localString.indexOf(':') + 1)); if (localString.startsWith("-") && namespaces.contains( localString.substring( 1, Math.max(1, localString.indexOf(':'))))) { - result = - "-" - + substring; + result = "-" + substring; } else if (namespaces.contains( localString.substring(0, Math.max(0, localString.indexOf(':'))))) { result = substring; diff --git a/src/test/java/com/github/underscore/ArraysTest.java b/src/test/java/com/github/underscore/ArraysTest.java index 0615f97b..718e18bb 100644 --- a/src/test/java/com/github/underscore/ArraysTest.java +++ b/src/test/java/com/github/underscore/ArraysTest.java @@ -659,7 +659,8 @@ void lastOrNull() { void compact() { final List result = Underscore.compact(asList(0, 1, false, 2, "", 3)); assertEquals("[1, 2, 3]", result.toString()); - final List result2 = Underscore.compactList(Arrays.asList(0, 1, false, 2, "", 3), 1); + final List result2 = + Underscore.compactList(Arrays.asList(0, 1, false, 2, "", 3), 1); assertEquals("[0, false, 2, , 3]", result2.toString()); final List result3 = Underscore.compact(asList(0, 1, null, 2, "", 3)); assertEquals("[1, 2, 3]", result3.toString()); diff --git a/src/test/java/com/github/underscore/CollectionsTest.java b/src/test/java/com/github/underscore/CollectionsTest.java index 3fe01ef5..9db87d8a 100644 --- a/src/test/java/com/github/underscore/CollectionsTest.java +++ b/src/test/java/com/github/underscore/CollectionsTest.java @@ -1301,8 +1301,7 @@ void sortWith() { Underscore.sortWith( asList(1, 2, 3, 4, 5, 6), (item1, item2) -> - (int) (Math.sin(item1) * 1000) - - (int) (Math.sin(item2) * 1000)); + (int) (Math.sin(item1) * 1000) - (int) (Math.sin(item2) * 1000)); assertEquals("[5, 4, 6, 3, 1, 2]", result.toString()); final List resultObj = new Underscore(asList(1, 2, 3, 4, 5, 6)) @@ -1318,8 +1317,7 @@ void sortWith() { (Comparator) (item1, item2) -> (int) (Math.sin(item1) * 1000) - - (int) (Math.sin(item2) * 1000) - ) + - (int) (Math.sin(item2) * 1000)) .value(); assertEquals("[5, 4, 6, 3, 1, 2]", resultChain.toString()); } @@ -1332,15 +1330,11 @@ void sortWith() { @SuppressWarnings("unchecked") void sortBy() { final List result = - Underscore.sortBy( - asList(1, 2, 3, 4, 5, 6), - item -> (int) (Math.sin(item) * 1000)); + Underscore.sortBy(asList(1, 2, 3, 4, 5, 6), item -> (int) (Math.sin(item) * 1000)); assertEquals("[5, 4, 6, 3, 1, 2]", result.toString()); final List resultObj = new Underscore(asList(1, 2, 3, 4, 5, 6)) - .sortBy( - (Function) - item -> (int) (Math.sin(item) * 1000)); + .sortBy((Function) item -> (int) (Math.sin(item) * 1000)); assertEquals("[5, 4, 6, 3, 1, 2]", resultObj.toString()); final List resultChain = Underscore.chain(asList(1, 2, 3, 4, 5, 6)) @@ -1719,8 +1713,7 @@ public Integer next() { } @Override - public void remove() { - } + public void remove() {} }; assertEquals(6, Underscore.size(iterable)); assertEquals(5, Underscore.size(new Integer[] {5, 4, 3, 2, 1})); diff --git a/src/test/java/com/github/underscore/LodashTest.java b/src/test/java/com/github/underscore/LodashTest.java index 7a47cb4c..2010e7c6 100644 --- a/src/test/java/com/github/underscore/LodashTest.java +++ b/src/test/java/com/github/underscore/LodashTest.java @@ -411,9 +411,9 @@ void set() { assertEquals( "d", U.set( - (Map) U.fromJson("{\"a\":[{\"b\":{\"c\":\"d\"}}]}"), - "a[0].b.c", - "e")); + (Map) U.fromJson("{\"a\":[{\"b\":{\"c\":\"d\"}}]}"), + "a[0].b.c", + "e")); assertEquals( "{b={c=d}}", U.set( @@ -615,24 +615,25 @@ void fetchGet() { "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json"); result.json(); result.jsonMap(); - assertEquals("{\n" - + " \"fruit\": \"Apple\",\n" - + " \"size\": \"Large\",\n" - + " \"color\": \"Red\"\n" - + "}", - result.text()); - assertEquals("Apple", - U.get((Map) result.json(), "fruit")); + assertEquals( + "{\n" + + " \"fruit\": \"Apple\",\n" + + " \"size\": \"Large\",\n" + + " \"color\": \"Red\"\n" + + "}", + result.text()); + assertEquals("Apple", U.get((Map) result.json(), "fruit")); U.Chain resultChain = U.chain( "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json") .fetch(); - assertEquals("{\n" - + " \"fruit\": \"Apple\",\n" - + " \"size\": \"Large\",\n" - + " \"color\": \"Red\"\n" - + "}", - resultChain.item()); + assertEquals( + "{\n" + + " \"fruit\": \"Apple\",\n" + + " \"size\": \"Large\",\n" + + " \"color\": \"Red\"\n" + + "}", + resultChain.item()); U.chain( "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json") .fetch(); @@ -665,12 +666,13 @@ void fetchGetWithTimeouts() { "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json", 30000, 30000); - assertEquals("{\n" - + " \"fruit\": \"Apple\",\n" - + " \"size\": \"Large\",\n" - + " \"color\": \"Red\"\n" - + "}", - result.text()); + assertEquals( + "{\n" + + " \"fruit\": \"Apple\",\n" + + " \"size\": \"Large\",\n" + + " \"color\": \"Red\"\n" + + "}", + result.text()); } @Test @@ -730,7 +732,7 @@ void fetchPut() { + " \"fireBreath\": 10" + " }" + "}"); - assertEquals(403, result.getStatus()); + assertEquals(403, result.getStatus()); U.FetchResponse result2 = U.fetch( "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json", @@ -760,13 +762,15 @@ void fetchPut() { + " \"fireBreath\": 10" + " }" + "}"); - assertEquals("\n" - + "301 Moved Permanently \n" - + "\n" - + "

301 Moved Permanently

\n" - + "
cloudflare
\n" - + "\n" - + "\n", resultChain.item().replace("\r\n", "\n")); + assertEquals( + "\n" + + "301 Moved Permanently \n" + + "\n" + + "

301 Moved Permanently

\n" + + "
cloudflare
\n" + + "\n" + + "\n", + resultChain.item().replace("\r\n", "\n")); } @Test @@ -1029,15 +1033,15 @@ void xmpToJson4() { @Test void xmpToJson5() { - assertEquals("{\n" + assertEquals( + "{\n" + " \"Comment\": {\n" + " \"-stringValue\": \"============================\",\n" + " \"-self-closing\": \"true\"\n" + " },\n" + " \"#omit-xml-declaration\": \"yes\"\n" + "}", - U.xmlToJson( - "")); + U.xmlToJson("")); } @Test @@ -1054,15 +1058,13 @@ void xmlToJsonMinimum() { + "}", U.xmlToJsonMinimum("12")); assertEquals( - "[\n" - + " \"a\",\n" - + " \"b\"\n" - + "]", - U.xmlToJsonMinimum("\n" - + "\n" - + " a\n" - + " b\n" - + "")); + "[\n" + " \"a\",\n" + " \"b\"\n" + "]", + U.xmlToJsonMinimum( + "\n" + + "\n" + + " a\n" + + " b\n" + + "")); } @Test @@ -1357,13 +1359,13 @@ void jsonToXml() { @Test void jsonToXmlMinimum() { - assertEquals("", - U.jsonToXmlMinimum("{\n \"a\": {\n }\n}")); - assertEquals("", + assertEquals("", U.jsonToXmlMinimum("{\n \"a\": {\n }\n}")); + assertEquals( + "", U.jsonToXmlMinimum("{\n \"a\": {\n }\n}", Xml.XmlStringBuilder.Step.TWO_SPACES)); - assertEquals("", - U.jsonToXmlMinimum("[]")); - assertEquals("\n" + assertEquals("", U.jsonToXmlMinimum("[]")); + assertEquals( + "\n" + " \n" + " 1\n" + " \n" diff --git a/src/test/java/com/github/underscore/StringTest.java b/src/test/java/com/github/underscore/StringTest.java index 692f3891..acba365c 100644 --- a/src/test/java/com/github/underscore/StringTest.java +++ b/src/test/java/com/github/underscore/StringTest.java @@ -1805,8 +1805,7 @@ void toJsonFromXml11() { + "}"; assertEquals(json, U.toJson((Map) U.fromXml(xml))); assertEquals(xml, U.toXml((Map) U.fromJson(json))); - final String xml2 = - "cc"; + final String xml2 = "cc"; assertEquals( "{\n" + " \"a\": {\n" @@ -2085,23 +2084,18 @@ void toJsonFromXml16() { @SuppressWarnings("unchecked") @Test void toJsonFromXml17() { - final String xml = - "\n1"; + final String xml = "\n1"; assertEquals("{\n \"a\": 1\n}", U.toJson((Map) U.fromXml(xml))); final String xml2 = "\n1e1"; - assertEquals( - "{\n \"a\": 10.0\n}", U.toJson((Map) U.fromXml(xml2))); + assertEquals("{\n \"a\": 10.0\n}", U.toJson((Map) U.fromXml(xml2))); final String xml3 = "\n1E1"; - assertEquals( - "{\n \"a\": 10.0\n}", U.toJson((Map) U.fromXml(xml3))); + assertEquals("{\n \"a\": 10.0\n}", U.toJson((Map) U.fromXml(xml3))); final String xml4 = "\n1.1"; - assertEquals( - "{\n \"a\": 1.1\n}", U.toJson((Map) U.fromXml(xml4))); - final String xml5 = - "\n1"; + assertEquals("{\n \"a\": 1.1\n}", U.toJson((Map) U.fromXml(xml4))); + final String xml5 = "\n1"; assertEquals( "{\n" + " \"a\": {\n" @@ -2160,10 +2154,8 @@ void toJsonFromXml17() { void toJsonFromXml18() { final String xml = "\ntrue"; - assertEquals( - "{\n \"a\": true\n}", U.toJson((Map) U.fromXml(xml))); - final String xml2 = - "\ntrue"; + assertEquals("{\n \"a\": true\n}", U.toJson((Map) U.fromXml(xml))); + final String xml2 = "\ntrue"; assertEquals( "{\n" + " \"a\": {\n" @@ -2238,8 +2230,7 @@ void toJsonFromXml19() { @Test void toJsonFromXml20() { final String xml = ""; - final String json = - "{\n \"a\": [\n ],\n \"#omit-xml-declaration\": \"yes\"\n}"; + final String json = "{\n \"a\": [\n ],\n \"#omit-xml-declaration\": \"yes\"\n}"; assertEquals(json, U.toJson((Map) U.fromXml(xml))); final String xml2 = ""; final String json2 = @@ -2251,8 +2242,7 @@ void toJsonFromXml20() { + "}"; assertEquals(json2, U.toJson((Map) U.fromXml(xml2))); final String xml3 = "1"; - final String json3 = - "{\n \"a\": \"1\",\n \"#omit-xml-declaration\": \"yes\"\n}"; + final String json3 = "{\n \"a\": \"1\",\n \"#omit-xml-declaration\": \"yes\"\n}"; assertEquals(json3, U.toJson((Map) U.fromXml(xml3))); final String xml4 = ""; final String json4 = @@ -2379,7 +2369,8 @@ void testMultipleAttributes() { @Test void testAttributeWithSpaces() { - Map result = Xml.parseAttributes("key1=\"value with spaces\" key2=\"another value\""); + Map result = + Xml.parseAttributes("key1=\"value with spaces\" key2=\"another value\""); assertEquals(Map.of("key1", "value with spaces", "key2", "another value"), result); } @@ -2483,13 +2474,11 @@ void toJsonFromXml23() { @Test void toJsonFromXml24() { final String xml = "\n\n \n"; - final String json = - "{\n \"a\": {\n \"?b\": \"c=\\\"d\\\"\"\n }\n}"; + final String json = "{\n \"a\": {\n \"?b\": \"c=\\\"d\\\"\"\n }\n}"; assertEquals(json, U.toJson((Map) U.fromXml(xml))); assertEquals(xml, U.toXml((Map) U.fromJson(json))); final String xml2 = "\n\n"; - final String json2 = - "{\n \"?b\": \"c=\\\"d\\\"\",\n \"a\": {\n }\n}"; + final String json2 = "{\n \"?b\": \"c=\\\"d\\\"\",\n \"a\": {\n }\n}"; assertEquals(json2, U.toJson((Map) U.fromXml(xml2))); assertEquals(xml2, U.toXml((Map) U.fromJson(json2))); final String xml3 = "\n\n \n"; @@ -3002,13 +2991,11 @@ void toXmlFromJson18() { @SuppressWarnings("unchecked") @Test void toXmlFromJson19() { - final String json = - "{\n \"a\": {\n },\n \"#encoding\": \"windows-1251\"\n}"; + final String json = "{\n \"a\": {\n },\n \"#encoding\": \"windows-1251\"\n}"; assertEquals( "\n", U.toXml((Map) U.fromJson(json))); - final String json2 = - "{\n \"a\": {\n },\n \"#encoding\": \"windows-9999\"\n}"; + final String json2 = "{\n \"a\": {\n },\n \"#encoding\": \"windows-9999\"\n}"; assertEquals( "\n", U.toXml((Map) U.fromJson(json2))); @@ -3110,8 +3097,7 @@ void toXmlFromJson24() { @SuppressWarnings("unchecked") @Test void toXmlFromJson25() { - final String json = - "{\n \"a\": [\n [\n 1\n ]\n ]\n}"; + final String json = "{\n \"a\": [\n [\n 1\n ]\n ]\n}"; final String xml = "\n" + "\n" diff --git a/src/test/java/com/github/underscore/UnderscoreTest.java b/src/test/java/com/github/underscore/UnderscoreTest.java index 09952755..4249a2c1 100644 --- a/src/test/java/com/github/underscore/UnderscoreTest.java +++ b/src/test/java/com/github/underscore/UnderscoreTest.java @@ -120,27 +120,35 @@ void join() { @Test void joinToString() { - assertEquals("[]", Underscore.joinToString(List.of(), ",", "[", "]", - 3, "...", null)); - assertEquals("[1,2,3]", Underscore.joinToString(List.of(1, 2, 3), ",", - "[", "]", -1, "...", null)); - assertEquals("[1,2,3]", Underscore.joinToString(List.of(1, 2, 3), ",", - "[", "]", 3, "...", null)); - assertEquals("[1,2,3,...]", Underscore.joinToString(List.of(1, 2, 3, 4, 5), ",", - "[", "]", 3, "...", null)); + assertEquals("[]", Underscore.joinToString(List.of(), ",", "[", "]", 3, "...", null)); + assertEquals( + "[1,2,3]", + Underscore.joinToString(List.of(1, 2, 3), ",", "[", "]", -1, "...", null)); + assertEquals( + "[1,2,3]", + Underscore.joinToString(List.of(1, 2, 3), ",", "[", "]", 3, "...", null)); + assertEquals( + "[1,2,3,...]", + Underscore.joinToString(List.of(1, 2, 3, 4, 5), ",", "[", "]", 3, "...", null)); Function transform = i -> "Value-" + i; - assertEquals("[Value-1,Value-2,Value-3]", Underscore.joinToString(List.of(1, 2, 3), ",", - "[", "]", -1, "...", transform)); - assertEquals("[1,2,3]", Underscore.joinToString(List.of(1, 2, 3), ",", - "[", "]", -1, "...", null)); - assertEquals("{1, 2, 3}", Underscore.joinToString(List.of(1, 2, 3), ", ", - "{", "}", -1, "...", null)); - assertEquals("1, 2, ...", Underscore.joinToString(List.of(1, 2, 3, 4), ", ", - "", "", 2, "...", null)); - assertEquals("1, 2, ...", Underscore.joinToString(List.of(1, 2, 3, 4), ", ", - null, null, 2, "...", null)); - assertEquals("1, 2, ...", Underscore.joinToString(List.of(1, 2, 3, 4), ", ", - null, null, 2, null, null)); + assertEquals( + "[Value-1,Value-2,Value-3]", + Underscore.joinToString(List.of(1, 2, 3), ",", "[", "]", -1, "...", transform)); + assertEquals( + "[1,2,3]", + Underscore.joinToString(List.of(1, 2, 3), ",", "[", "]", -1, "...", null)); + assertEquals( + "{1, 2, 3}", + Underscore.joinToString(List.of(1, 2, 3), ", ", "{", "}", -1, "...", null)); + assertEquals( + "1, 2, ...", + Underscore.joinToString(List.of(1, 2, 3, 4), ", ", "", "", 2, "...", null)); + assertEquals( + "1, 2, ...", + Underscore.joinToString(List.of(1, 2, 3, 4), ", ", null, null, 2, "...", null)); + assertEquals( + "1, 2, ...", + Underscore.joinToString(List.of(1, 2, 3, 4), ", ", null, null, 2, null, null)); } /* diff --git a/src/test/java/com/github/underscore/UtilityTest.java b/src/test/java/com/github/underscore/UtilityTest.java index 491ed6a4..fb0e5ee2 100644 --- a/src/test/java/com/github/underscore/UtilityTest.java +++ b/src/test/java/com/github/underscore/UtilityTest.java @@ -481,9 +481,7 @@ void result() { @Test void joinToString() { - assertEquals("[]", U.joinToString(List.of(), ",", - "[", "]", 3, "...", null)); - assertEquals("[1,2,3]", U.joinToString(List.of(1, 2, 3), ",", - "[", "]", -1, "...", null)); + assertEquals("[]", U.joinToString(List.of(), ",", "[", "]", 3, "...", null)); + assertEquals("[1,2,3]", U.joinToString(List.of(1, 2, 3), ",", "[", "]", -1, "...", null)); } } From 14be82aff7994bbe8c00e78f9de0c7bf68bd5624 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 08:32:02 +0200 Subject: [PATCH 14/17] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.6 to 4.9.1.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0ec9a982..c15ee0d7 100644 --- a/pom.xml +++ b/pom.xml @@ -187,7 +187,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.8.6.6 + 4.9.1.0 From 529ff844a921dc9c4a0bb234e4eb73263a605484 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Tue, 18 Feb 2025 14:09:39 +0200 Subject: [PATCH 15/17] Version 1.111 --- README.md | 6 +++--- pom-central.xml | 2 +- pom-pack.xml | 2 +- pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8b8cada4..deb06b7a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ underscore-java =============== -[![Maven Central](https://img.shields.io/maven-central/v/com.github.javadev/underscore.svg)](https://central.sonatype.com/artifact/com.github.javadev/underscore/1.110) +[![Maven Central](https://img.shields.io/maven-central/v/com.github.javadev/underscore.svg)](https://central.sonatype.com/artifact/com.github.javadev/underscore/1.111) [![MIT License](http://img.shields.io/badge/license-MIT-green.svg)](https://github.com/javadev/underscore-java/blob/main/LICENSE) [![Java CI](https://github.com/javadev/underscore-java/actions/workflows/maven.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/maven.yml) [![CodeQL](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml/badge.svg)](https://github.com/javadev/underscore-java/actions/workflows/codeql.yml) @@ -43,7 +43,7 @@ To configure your Maven project, add the following code to your pom.xml file: com.github.javadev underscore - 1.110 + 1.111 ... @@ -52,7 +52,7 @@ To configure your Maven project, add the following code to your pom.xml file: Gradle configuration: ```groovy -implementation 'com.github.javadev:underscore:1.110' +implementation 'com.github.javadev:underscore:1.111' ``` ### Usage diff --git a/pom-central.xml b/pom-central.xml index 3ca582d4..ef79c120 100644 --- a/pom-central.xml +++ b/pom-central.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.110 + 1.111 java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java diff --git a/pom-pack.xml b/pom-pack.xml index b9ab6314..95030454 100644 --- a/pom-pack.xml +++ b/pom-pack.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.110 + 1.111 java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java diff --git a/pom.xml b/pom.xml index c15ee0d7..5de5e835 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.javadev underscore jar - 1.110-SNAPSHOT + 1.111-SNAPSHOT java port of Underscore.js The java port of Underscore.js https://github.com/javadev/underscore-java From a024d9cf578dae10ccb411d06eaf461b0816091d Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Fri, 21 Feb 2025 01:22:01 +0200 Subject: [PATCH 16/17] Spring boot 3.4.3 --- spring-boot-example/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-example/pom.xml b/spring-boot-example/pom.xml index 91c3d91c..9a92d91f 100644 --- a/spring-boot-example/pom.xml +++ b/spring-boot-example/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.1 + 3.4.3 com.example From dfd29d73e46aab34f96aab00628446c0c147f469 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Sun, 23 Feb 2025 21:46:36 +0200 Subject: [PATCH 17/17] Updated copyright headers to 2025 --- src/main/java/com/github/underscore/Base32.java | 2 +- src/main/java/com/github/underscore/Json.java | 2 +- src/main/java/com/github/underscore/U.java | 2 +- src/main/java/com/github/underscore/Underscore.java | 2 +- src/main/java/com/github/underscore/Xml.java | 2 +- src/main/java/com/github/underscore/XmlBuilder.java | 2 +- src/test/java/com/github/underscore/ArraysTest.java | 2 +- src/test/java/com/github/underscore/Base32Test.java | 2 +- src/test/java/com/github/underscore/ChainingTest.java | 2 +- src/test/java/com/github/underscore/CollectionsTest.java | 2 +- src/test/java/com/github/underscore/FunctionsTest.java | 2 +- src/test/java/com/github/underscore/LodashTest.java | 2 +- src/test/java/com/github/underscore/MathTest.java | 2 +- src/test/java/com/github/underscore/ObjectsTest.java | 2 +- src/test/java/com/github/underscore/StringTest.java | 2 +- src/test/java/com/github/underscore/UnderscoreTest.java | 2 +- src/test/java/com/github/underscore/UtilityTest.java | 2 +- src/test/java/com/github/underscore/XmlBuilderTest.java | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/github/underscore/Base32.java b/src/main/java/com/github/underscore/Base32.java index 4e9f3a84..2ee68064 100644 --- a/src/main/java/com/github/underscore/Base32.java +++ b/src/main/java/com/github/underscore/Base32.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/underscore/Json.java b/src/main/java/com/github/underscore/Json.java index 1a054d09..0486eb86 100644 --- a/src/main/java/com/github/underscore/Json.java +++ b/src/main/java/com/github/underscore/Json.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/underscore/U.java b/src/main/java/com/github/underscore/U.java index 0e868f92..9db4c139 100644 --- a/src/main/java/com/github/underscore/U.java +++ b/src/main/java/com/github/underscore/U.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/underscore/Underscore.java b/src/main/java/com/github/underscore/Underscore.java index 57c6f014..01541df7 100644 --- a/src/main/java/com/github/underscore/Underscore.java +++ b/src/main/java/com/github/underscore/Underscore.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/underscore/Xml.java b/src/main/java/com/github/underscore/Xml.java index 0770a0cc..6d2f6c83 100644 --- a/src/main/java/com/github/underscore/Xml.java +++ b/src/main/java/com/github/underscore/Xml.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/underscore/XmlBuilder.java b/src/main/java/com/github/underscore/XmlBuilder.java index 13eddacc..0cbaafcc 100644 --- a/src/main/java/com/github/underscore/XmlBuilder.java +++ b/src/main/java/com/github/underscore/XmlBuilder.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2023-2024 Valentyn Kolesnikov + * Copyright 2023-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/ArraysTest.java b/src/test/java/com/github/underscore/ArraysTest.java index 718e18bb..fa231258 100644 --- a/src/test/java/com/github/underscore/ArraysTest.java +++ b/src/test/java/com/github/underscore/ArraysTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/Base32Test.java b/src/test/java/com/github/underscore/Base32Test.java index abf65cc2..93a00bae 100644 --- a/src/test/java/com/github/underscore/Base32Test.java +++ b/src/test/java/com/github/underscore/Base32Test.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/ChainingTest.java b/src/test/java/com/github/underscore/ChainingTest.java index ac026af8..51490e4d 100644 --- a/src/test/java/com/github/underscore/ChainingTest.java +++ b/src/test/java/com/github/underscore/ChainingTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/CollectionsTest.java b/src/test/java/com/github/underscore/CollectionsTest.java index 9db87d8a..cb132091 100644 --- a/src/test/java/com/github/underscore/CollectionsTest.java +++ b/src/test/java/com/github/underscore/CollectionsTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/FunctionsTest.java b/src/test/java/com/github/underscore/FunctionsTest.java index 60206d55..c22ed98b 100644 --- a/src/test/java/com/github/underscore/FunctionsTest.java +++ b/src/test/java/com/github/underscore/FunctionsTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/LodashTest.java b/src/test/java/com/github/underscore/LodashTest.java index 2010e7c6..8e905aee 100644 --- a/src/test/java/com/github/underscore/LodashTest.java +++ b/src/test/java/com/github/underscore/LodashTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/MathTest.java b/src/test/java/com/github/underscore/MathTest.java index 6eae0c10..5ebce81a 100644 --- a/src/test/java/com/github/underscore/MathTest.java +++ b/src/test/java/com/github/underscore/MathTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/ObjectsTest.java b/src/test/java/com/github/underscore/ObjectsTest.java index 9cc8174f..b5596cb8 100644 --- a/src/test/java/com/github/underscore/ObjectsTest.java +++ b/src/test/java/com/github/underscore/ObjectsTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/StringTest.java b/src/test/java/com/github/underscore/StringTest.java index acba365c..104c4dbd 100644 --- a/src/test/java/com/github/underscore/StringTest.java +++ b/src/test/java/com/github/underscore/StringTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/UnderscoreTest.java b/src/test/java/com/github/underscore/UnderscoreTest.java index 4249a2c1..59caff8f 100644 --- a/src/test/java/com/github/underscore/UnderscoreTest.java +++ b/src/test/java/com/github/underscore/UnderscoreTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/UtilityTest.java b/src/test/java/com/github/underscore/UtilityTest.java index fb0e5ee2..98a4ffcc 100644 --- a/src/test/java/com/github/underscore/UtilityTest.java +++ b/src/test/java/com/github/underscore/UtilityTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2015-2024 Valentyn Kolesnikov + * Copyright 2015-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/test/java/com/github/underscore/XmlBuilderTest.java b/src/test/java/com/github/underscore/XmlBuilderTest.java index f2ae1394..07ac2872 100644 --- a/src/test/java/com/github/underscore/XmlBuilderTest.java +++ b/src/test/java/com/github/underscore/XmlBuilderTest.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright 2023-2024 Valentyn Kolesnikov + * Copyright 2023-2025 Valentyn Kolesnikov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal