[Git][java-team/snakeyaml][upstream] New upstream version 2.6

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Fri Nov 13 16:54:44 GMT 2026



Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / snakeyaml


Commits:
75488c3e by Emmanuel Bourg at 2026-11-13T17:15:54+01:00
New upstream version 2.6
- - - - -


12 changed files:

- + docker-run-jdk25.sh
- pom.xml
- src/changes/changes.xml
- src/main/java/org/yaml/snakeyaml/inspector/TagInspector.java
- src/main/java/org/yaml/snakeyaml/inspector/UnTrustedTagInspector.java
- src/main/java/org/yaml/snakeyaml/reader/StreamReader.java
- src/main/java/org/yaml/snakeyaml/scanner/ScannerImpl.java
- src/test/java/org/yaml/snakeyaml/issues/issue1108/DumpCommentInFlowStyleTest.java
- + src/test/java/org/yaml/snakeyaml/issues/issue1110/ParseJsonTest.java
- src/test/java/org/yaml/snakeyaml/scanner/ScannerImplTest.java
- + src/test/resources/issues/issue1110-leading-tab.json
- + src/test/resources/issues/issue1110-mtad.json


Changes:

=====================================
docker-run-jdk25.sh
=====================================
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+./run-in-docker.sh eclipse-temurin:25 $@


=====================================
pom.xml
=====================================
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.yaml</groupId>
     <artifactId>snakeyaml</artifactId>
-    <version>2.5</version>
+    <version>2.6</version>
     <packaging>bundle</packaging>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -37,7 +37,7 @@
         <connection>scm:git:http://bitbucket.org/snakeyaml/snakeyaml</connection>
         <developerConnection>scm:git:ssh://git@bitbucket.org/snakeyaml/snakeyaml</developerConnection>
         <url>https://bitbucket.org/snakeyaml/snakeyaml/src</url>
-        <tag>snakeyaml-2.5</tag>
+        <tag>snakeyaml-2.6</tag>
     </scm>
     <licenses>
         <license>
@@ -80,7 +80,7 @@
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
-            <version>1.18.30</version>
+            <version>1.18.42</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -203,6 +203,12 @@
                               </jdkToolchain>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>default-testCompile</id>
+                        <configuration>
+                            <proc>full</proc>
+                        </configuration>
+                    </execution>
                 </executions>
             </plugin>
             <plugin>


=====================================
src/changes/changes.xml
=====================================
@@ -5,7 +5,18 @@
         <title>YAML 1.1 parser and emitter</title>
     </properties>
     <body>
-        <release version="2.5" date="in GIT" description="Maintenance">
+        <release version="2.6" date="in GIT" description="Maintenance">
+            <action dev="asomov" type="update" issue="1110">
+                Parse JSON with any leading TABs (thanks to Kristian Atanasov)
+            </action>
+            <action dev="asomov" type="update" issue="1109">
+                Add example to migrate to SnakeYAML Engine and provide a custom resolver (thanks to Joacim Breiler)
+            </action>
+        </release>
+        <release version="2.5" date="2025-08-31" description="Maintenance">
+            <action dev="asomov" type="add">
+                Add build with JDK 25
+            </action>
             <action dev="asomov" type="fix">
                 Emitting an empty string, as a list element, with block comment, creates invalid YAML (thanks to Anand Beh)
             </action>


=====================================
src/main/java/org/yaml/snakeyaml/inspector/TagInspector.java
=====================================
@@ -17,8 +17,8 @@ import org.yaml.snakeyaml.nodes.Tag;
 
 /**
  * Check if the global tags are allowed (the local tags are always allowed). It should control the
- * classes to create to prevent possible remote code invocation when the data comes from untrusted
- * source. The standard tags are always allowed (https://yaml.org/type/index.html)
+ * classes to create to prevent possible remote code invocation when the data comes from an
+ * untrusted source. The standard tags are always allowed (https://yaml.org/type/index.html)
  */
 public interface TagInspector {
 


=====================================
src/main/java/org/yaml/snakeyaml/inspector/UnTrustedTagInspector.java
=====================================
@@ -16,8 +16,8 @@ package org.yaml.snakeyaml.inspector;
 import org.yaml.snakeyaml.nodes.Tag;
 
 /**
- * TagInspector which does not allow to create any custom instance. It should not be used when the
- * data comes from untrusted source to prevent possible remote code invocation.
+ * TagInspector, which does not allow creating any custom instance. It should be used when the data
+ * comes from an untrusted source to prevent possible remote code invocation.
  */
 public final class UnTrustedTagInspector implements TagInspector {
 


=====================================
src/main/java/org/yaml/snakeyaml/reader/StreamReader.java
=====================================
@@ -22,20 +22,20 @@ import org.yaml.snakeyaml.error.YAMLException;
 import org.yaml.snakeyaml.scanner.Constant;
 
 /**
- * Reader: checks if code points are in allowed range. Returns '\0' when end of data has been
- * reached.
+ * Reader: checks if code points are in the allowed range. Returns '\0' when the end of data has
+ * been reached.
  */
 public class StreamReader {
 
   private String name;
   private final Reader stream;
   /**
-   * Read data (as a moving window for input stream)
+   * Read data (as a moving window for the input stream)
    */
   private int[] dataWindow;
 
   /**
-   * Real length of the data in dataWindow
+   * Real length of the data in the dataWindow
    */
   private int dataLength;
 
@@ -98,10 +98,10 @@ public class StreamReader {
   }
 
   /**
-   * read the next length characters and move the pointer. if the last character is high surrogate
+   * read the next length characters and move the pointer. if the last character is high surrogate,
    * one more character will be read
    *
-   * @param length amount of characters to move forward
+   * @param length number of characters to move forward
    */
   public void forward(int length) {
     for (int i = 0; i < length && ensureEnoughData(); i++) {
@@ -134,7 +134,7 @@ public class StreamReader {
   /**
    * peek the next length code points
    *
-   * @param length amount of the characters to peek
+   * @param length number of the characters to peek
    * @return the next length code points
    */
   public String prefix(int length) {
@@ -150,7 +150,7 @@ public class StreamReader {
   /**
    * prefix(length) immediately followed by forward(length)
    *
-   * @param length amount of characters to get
+   * @param length number of characters to get
    * @return the next length code points
    */
   public String prefixForward(int length) {
@@ -242,7 +242,7 @@ public class StreamReader {
   }
 
   /**
-   * @return current position as number (in characters) from the beginning of the stream
+   * @return current position as a number (in characters) from the beginning of the stream
    */
   public int getIndex() {
     return index;


=====================================
src/main/java/org/yaml/snakeyaml/scanner/ScannerImpl.java
=====================================
@@ -1231,6 +1231,9 @@ public final class ScannerImpl implements Scanner {
       while (reader.peek(ff) == ' ') {
         ff++;
       }
+      while (reader.peek(ff) == '\t' && this.flowLevel > 0) {
+        ff++;
+      }
       if (ff > 0) {
         reader.forward(ff);
       }


=====================================
src/test/java/org/yaml/snakeyaml/issues/issue1108/DumpCommentInFlowStyleTest.java
=====================================
@@ -13,6 +13,11 @@
  */
 package org.yaml.snakeyaml.issues.issue1108;
 
+import static org.junit.Assert.assertEquals;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.List;
 import org.junit.Test;
 import org.yaml.snakeyaml.DumperOptions;
 import org.yaml.snakeyaml.LoaderOptions;
@@ -24,12 +29,6 @@ import org.yaml.snakeyaml.nodes.Node;
 import org.yaml.snakeyaml.nodes.NodeTuple;
 import org.yaml.snakeyaml.representer.Representer;
 
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
 public class DumpCommentInFlowStyleTest {
 
   private static DumperOptions getDumperOptions() {
@@ -97,9 +96,12 @@ public class DumpCommentInFlowStyleTest {
   public void readAndWriteCommentsInFlowStyleInSequence() {
     Yaml yaml = getYaml();
     String content = "[\n" + "  # red\n" + "  one, # comment\n" + "  # blue\n" + "  two\n" + "]";
+    int counter = 0;
     for (Event event : yaml.parse(new StringReader(content))) {
-      System.out.println(event);
+      // System.out.println(event);
+      counter++;
     }
+    assertEquals(11, counter);
 
     Node node = yaml.compose(new StringReader(content));
     StringWriter output = new StringWriter();


=====================================
src/test/java/org/yaml/snakeyaml/issues/issue1110/ParseJsonTest.java
=====================================
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2008, SnakeYAML
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.yaml.snakeyaml.issues.issue1110;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Map;
+import org.junit.Test;
+import org.yaml.snakeyaml.Util;
+import org.yaml.snakeyaml.Yaml;
+
+public class ParseJsonTest {
+
+  /**
+   * <a href=
+   * "https://bitbucket.org/snakeyaml/snakeyaml/issues/1110/exception-during-parse-of-tab-idented-json">cf-app</a>
+   */
+  @Test
+  public void testJsonWithTabs() {
+    String str = Util.getLocalResource("issues/issue1110-mtad.json");
+    Yaml yaml = new Yaml();
+    Map<String, Object> obj = (Map<String, Object>) yaml.load(str);
+    assertEquals(4, obj.size());
+    assertTrue(obj.containsKey("_schema-version"));
+  }
+
+  @Test
+  public void testJsonWithTabsSmall() {
+    String str = Util.getLocalResource("issues/issue1110-leading-tab.json");
+    Yaml yaml = new Yaml();
+    Map<String, Object> obj = (Map<String, Object>) yaml.load(str);
+    assertEquals(3, obj.size());
+    assertTrue(obj.containsKey("modules"));
+  }
+}


=====================================
src/test/java/org/yaml/snakeyaml/scanner/ScannerImplTest.java
=====================================
@@ -13,7 +13,6 @@
  */
 package org.yaml.snakeyaml.scanner;
 
-import java.util.LinkedList;
 import junit.framework.TestCase;
 import org.yaml.snakeyaml.DumperOptions;
 import org.yaml.snakeyaml.LoaderOptions;
@@ -29,6 +28,8 @@ import org.yaml.snakeyaml.tokens.StreamStartToken;
 import org.yaml.snakeyaml.tokens.Token;
 import org.yaml.snakeyaml.tokens.ValueToken;
 
+import java.util.LinkedList;
+
 public class ScannerImplTest extends TestCase {
 
   public void testGetToken() {


=====================================
src/test/resources/issues/issue1110-leading-tab.json
=====================================
@@ -0,0 +1,7 @@
+{
+	"ID": 1,
+	"modules": [
+	3, 0
+	],
+	"version": "1.0"
+}


=====================================
src/test/resources/issues/issue1110-mtad.json
=====================================
@@ -0,0 +1,32 @@
+{
+	"ID": "a.cf.app",
+	"_schema-version": "3.3.0",
+	"modules": [
+		{
+			"name": "my-mta-managed-app-module",
+			"parameters": {
+				"app-features": {
+					"ssh": true
+				},
+				"app-name": "my-cf-app",
+				"buildpack": "staticfile_buildpack",
+				"disk-quota": "1G",
+				"health-check-http-endpoint": "/index",
+				"health-check-timeout": 180,
+				"health-check-type": "http",
+				"instances": 1,
+				"memory": "1G",
+				"no-route": false,
+				"no-start": false,
+				"upload-timeout": 180
+			},
+			"path": "appBits.zip",
+			"properties": {
+				"A_MORE_COMPLEX_VAR": "{ \"can be an entire\":\"json object\", \"with\": [ \"nested\": { \"elements\": \"${default-url}\" } ]",
+				"MY_CF_APP_ENV_VARIABLE": "HELLO MTA"
+			},
+			"type": "application"
+		}
+	],
+	"version": "0.0.0"
+}
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/java-team/snakeyaml/-/commit/75488c3e67901a2c4f30b428eb2dde23dae850f9

-- 
View it on GitLab: https://salsa.debian.org/java-team/snakeyaml/-/commit/75488c3e67901a2c4f30b428eb2dde23dae850f9
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20261113/286aa7b1/attachment.htm>


More information about the pkg-java-commits mailing list