[Git][java-team/msgpack-java][upstream] New upstream version 0.9.6

Andrius Merkys (@merkys) gitlab at salsa.debian.org
Thu Oct 26 09:58:55 BST 2023



Andrius Merkys pushed to branch upstream at Debian Java Maintainers / msgpack-java


Commits:
9ec23cb2 by Andrius Merkys at 2023-10-26T01:21:42-04:00
New upstream version 0.9.6
- - - - -


12 changed files:

- .github/release-drafter.yml
- + .github/release.yml
- .github/workflows/CI.yml
- .github/workflows/release-drafter.yml
- + .github/workflows/release-note.yml
- .github/workflows/snapshot.yml
- README.md
- build.sbt
- msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java
- msgpack-core/src/main/java/org/msgpack/core/buffer/DirectBufferAccess.java
- project/build.properties
- project/plugins.sbt


Changes:

=====================================
.github/release-drafter.yml
=====================================
@@ -43,10 +43,10 @@ autolabeler:
       - '*.md'
   - label: 'feature'
     title:
-      - '/(support|add)/i'
+      - '/(feature|support)/i'
   - label: 'bug'
     title:
-      - '/fix/i'
+      - '/(fix|bug)/i'
   - label: 'internal'
     title:
       - '/internal/i'


=====================================
.github/release.yml
=====================================
@@ -0,0 +1,31 @@
+changelog:
+  categories:
+    - title: '🔥 Breaking Changes'
+      labels:
+        - 'breaking'
+    - title: '👋 Deprecated'
+      labels:
+        - 'deprecation'
+    - title: '🚀 Features'
+      labels:
+        - 'feature'
+        - 'enhancement'
+    - title: '🐛 Bug Fixes'
+      labels:
+        - 'bug'
+    - title: '🔗 Dependency Updates'
+      labels:
+        - 'library-update'
+        - 'dependencies'
+    - title: '🛠  Internal Updates'
+      labels:
+        - 'internal'
+        - 'kaizen'
+        - 'test-library-update'
+        - 'sbt-plugin-update'
+    - title: '📚 Docs'
+      labels:
+        - 'doc'
+    - title: Other Changes
+      labels:
+        - "*"


=====================================
.github/workflows/CI.yml
=====================================
@@ -10,8 +10,6 @@ on:
       - 'project/build.properties'
   push:
     branches:
-      - master
-      - develop
       - main
     paths:
       - '**.scala'
@@ -29,6 +27,24 @@ jobs:
       - uses: actions/checkout at v2
       - name: jcheckstyle
         run: ./sbt jcheckStyle
+  test_jdk21:
+    name: Test JDK21
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout at v2
+      - uses: actions/setup-java at v3
+        with:
+          distribution: 'zulu'
+          java-version: '21'
+      - uses: actions/cache at v2
+        with:
+          path: ~/.cache
+          key: ${{ runner.os }}-jdk21-${{ hashFiles('**/*.sbt') }}
+          restore-keys: ${{ runner.os }}-jdk21-
+      - name: Test
+        run: ./sbt test
+      - name: Universal Buffer Test
+        run: ./sbt test -J-Dmsgpack.universal-buffer=true
   test_jdk17:
     name: Test JDK17
     runs-on: ubuntu-latest
@@ -41,7 +57,7 @@ jobs:
       - uses: actions/cache at v2
         with:
           path: ~/.cache
-          key: ${{ runner.os }}-jdk11-${{ hashFiles('**/*.sbt') }}
+          key: ${{ runner.os }}-jdk17-${{ hashFiles('**/*.sbt') }}
           restore-keys: ${{ runner.os }}-jdk17-
       - name: Test
         run: ./sbt test


=====================================
.github/workflows/release-drafter.yml
=====================================
@@ -1,10 +1,6 @@
 name: Release Drafter
 
 on:
-  push:
-    branches:
-      - develop
-      - main
   # pull_request event is required only for autolabeler
   pull_request:
     # Only following types are handled by the action, but one can default to all as well
@@ -12,15 +8,14 @@ on:
   # pull_request_target event is required for autolabeler to support PRs from forks
   pull_request_target:
     types: [opened, reopened, synchronize]
-  
+
 permissions:
   contents: read
 
 jobs:
   update_release_draft:
     permissions:
-      # write permission is required to create a github release
-      contents: write
+      contents: read
       # write permission is required for autolabeler
       # otherwise, read permission is required at least
       pull-requests: write


=====================================
.github/workflows/release-note.yml
=====================================
@@ -0,0 +1,18 @@
+name: Release Note
+
+on:
+  push:
+    tags:
+      - v*
+  workflow_dispatch:      
+
+jobs:
+  release:
+    name: Create a new release note
+    runs-on: ubuntu-latest
+    steps:         
+      - name: Create a release note
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          gh release create "$GITHUB_REF_NAME" --repo="$GITHUB_REPOSITORY" --generate-notes


=====================================
.github/workflows/snapshot.yml
=====================================
@@ -3,7 +3,6 @@ name: Snapshot Release
 on:
   push:
     branches:
-      - develop
       - main
     paths:
       - '**.scala'


=====================================
README.md
=====================================
@@ -96,14 +96,14 @@ Here is a list of sbt commands for daily development:
 
 ### Publish to Sonatype (Maven Central)
 
-To publish a new version, you only need to add a new git tag and push it to GitHub. GitHub Action will deploy a new release version to Maven Central (Sonatype).
+To publish a new version, add a new git tag and push it to GitHub. GitHub Action will deploy a new release version to Maven Central (Sonatype).
 
 ```scala
 $ git tag v0.x.y
 $ git push origin v0.x.y
 ```
 
-A draft of the next release note will be updated automatically at the [GitHub Releases](https://github.com/msgpack/msgpack-java/releases) page. For each PR merged, [release-drafter](https://github.com/release-drafter/release-drafter) will modify the release note draft. When you create a new release tag, edit and publish the draft of the release note. If necessary, adjust the version number and target tag.
+A new release note will be generated automatically at the [GitHub Releases](https://github.com/msgpack/msgpack-java/releases) page. 
 
 #### Publishing to Sonatype from Local Machine
 


=====================================
build.sbt
=====================================
@@ -5,7 +5,7 @@ Global / concurrentRestrictions := Seq(
   Tags.limit(Tags.Test, 1)
 )
 
-val AIRFRAME_VERSION = "23.7.2"
+val AIRFRAME_VERSION = "23.9.1"
 
 // Use dynamic snapshot version strings for non tagged versions
 ThisBuild / dynverSonatypeSnapshots := true
@@ -17,7 +17,7 @@ val buildSettings = Seq[Setting[_]](
   organizationName := "MessagePack",
   organizationHomepage := Some(new URL("http://msgpack.org/")),
   description := "MessagePack for Java",
-  scalaVersion := "2.13.6",
+  scalaVersion := "2.13.12",
   Test / logBuffered := false,
   // msgpack-java should be a pure-java library, so remove Scala specific configurations
   autoScalaLibrary := false,
@@ -26,11 +26,11 @@ val buildSettings = Seq[Setting[_]](
   // JVM options for building
   scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-feature"),
   Test / javaOptions ++= Seq("-ea"),
-  javacOptions ++= Seq("-source", "1.7", "-target", "1.7"),
+  javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
   Compile / compile / javacOptions ++= Seq("-encoding", "UTF-8", "-Xlint:unchecked", "-Xlint:deprecation"),
   // Use lenient validation mode when generating Javadoc (for Java8)
   doc / javacOptions := {
-    val opts = Seq("-source", "1.7")
+    val opts = Seq("-source", "1.8")
     if (scala.util.Properties.isJavaAtLeast("1.8")) {
       opts ++ Seq("-Xdoclint:none")
     } else {
@@ -92,7 +92,7 @@ lazy val msgpackCore = Project(id = "msgpack-core", base = file("msgpack-core"))
       "org.msgpack" % "msgpack" % "0.6.12" % "test",
       // For integration test with Akka
       "com.typesafe.akka"      %% "akka-actor"              % "2.6.20" % "test",
-      "org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0"  % "test"
+      "org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0" % "test"
     )
   )
 


=====================================
msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java
=====================================
@@ -342,7 +342,7 @@ public class MessageUnpacker
     }
 
     /**
-     * Returns true true if this unpacker has more elements.
+     * Returns true if this unpacker has more elements.
      * When this returns true, subsequent call to {@link #getNextFormat()} returns an
      * MessageFormat instance. If false, next {@link #getNextFormat()} call will throw an MessageInsufficientBufferException.
      *
@@ -759,7 +759,7 @@ public class MessageUnpacker
     /**
      * Peeks a Nil byte and reads it if next byte is a nil value.
      *
-     * The difference from {@link unpackNil} is that unpackNil throws an exception if the next byte is not nil value
+     * The difference from {@link #unpackNil()} is that unpackNil throws an exception if the next byte is not nil value
      * while this tryUnpackNil method returns false without changing position.
      *
      * @return true if a nil value is read


=====================================
msgpack-core/src/main/java/org/msgpack/core/buffer/DirectBufferAccess.java
=====================================
@@ -37,6 +37,7 @@ class DirectBufferAccess
 
     enum DirectBufferConstructorType
     {
+        ARGS_LONG_LONG,
         ARGS_LONG_INT_REF,
         ARGS_LONG_INT,
         ARGS_INT_INT,
@@ -64,28 +65,35 @@ class DirectBufferAccess
             DirectBufferConstructorType constructorType = null;
             Method mbWrap = null;
             try {
-                // TODO We should use MethodHandle for Java7, which can avoid the cost of boxing with JIT optimization
-                directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(long.class, int.class, Object.class);
-                constructorType = DirectBufferConstructorType.ARGS_LONG_INT_REF;
+                // JDK21 DirectByteBuffer(long, long)
+                directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(long.class, long.class);
+                constructorType = DirectBufferConstructorType.ARGS_LONG_LONG;
             }
-            catch (NoSuchMethodException e0) {
+            catch (NoSuchMethodException e00) {
                 try {
-                    // https://android.googlesource.com/platform/libcore/+/master/luni/src/main/java/java/nio/DirectByteBuffer.java
-                    // DirectByteBuffer(long address, int capacity)
-                    directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(long.class, int.class);
-                    constructorType = DirectBufferConstructorType.ARGS_LONG_INT;
+                    // TODO We should use MethodHandle for Java7, which can avoid the cost of boxing with JIT optimization
+                    directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(long.class, int.class, Object.class);
+                    constructorType = DirectBufferConstructorType.ARGS_LONG_INT_REF;
                 }
-                catch (NoSuchMethodException e1) {
+                catch (NoSuchMethodException e0) {
                     try {
-                        directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(int.class, int.class);
-                        constructorType = DirectBufferConstructorType.ARGS_INT_INT;
+                        // https://android.googlesource.com/platform/libcore/+/master/luni/src/main/java/java/nio/DirectByteBuffer.java
+                        // DirectByteBuffer(long address, int capacity)
+                        directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(long.class, int.class);
+                        constructorType = DirectBufferConstructorType.ARGS_LONG_INT;
                     }
-                    catch (NoSuchMethodException e2) {
-                        Class<?> aClass = Class.forName("java.nio.MemoryBlock");
-                        mbWrap = aClass.getDeclaredMethod("wrapFromJni", int.class, long.class);
-                        mbWrap.setAccessible(true);
-                        directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(aClass, int.class, int.class);
-                        constructorType = DirectBufferConstructorType.ARGS_MB_INT_INT;
+                    catch (NoSuchMethodException e1) {
+                        try {
+                            directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(int.class, int.class);
+                            constructorType = DirectBufferConstructorType.ARGS_INT_INT;
+                        }
+                        catch (NoSuchMethodException e2) {
+                            Class<?> aClass = Class.forName("java.nio.MemoryBlock");
+                            mbWrap = aClass.getDeclaredMethod("wrapFromJni", int.class, long.class);
+                            mbWrap.setAccessible(true);
+                            directByteBufferConstructor = directByteBufferClass.getDeclaredConstructor(aClass, int.class, int.class);
+                            constructorType = DirectBufferConstructorType.ARGS_MB_INT_INT;
+                        }
                     }
                 }
             }
@@ -281,6 +289,8 @@ class DirectBufferAccess
         }
         try {
             switch (directBufferConstructorType) {
+                case ARGS_LONG_LONG:
+                    return (ByteBuffer) byteBufferConstructor.newInstance(address + index, (long) length);
                 case ARGS_LONG_INT_REF:
                     return (ByteBuffer) byteBufferConstructor.newInstance(address + index, length, reference);
                 case ARGS_LONG_INT:


=====================================
project/build.properties
=====================================
@@ -1,2 +1,2 @@
-sbt.version=1.9.3
+sbt.version=1.9.6
 


=====================================
project/plugins.sbt
=====================================
@@ -5,7 +5,7 @@ addSbtPlugin("com.github.sbt" % "sbt-pgp"      % "2.2.1")
 //addSbtPlugin("com.github.sbt"   % "sbt-jacoco"      % "3.3.0")
 addSbtPlugin("org.xerial.sbt"   % "sbt-jcheckstyle" % "0.2.1")
 addSbtPlugin("com.typesafe.sbt" % "sbt-osgi"        % "0.9.6")
-addSbtPlugin("org.scalameta"    % "sbt-scalafmt"    % "2.5.0")
+addSbtPlugin("org.scalameta"    % "sbt-scalafmt"    % "2.5.2")
 addSbtPlugin("com.github.sbt"     % "sbt-dynver"      % "5.0.1")
 
 scalacOptions ++= Seq("-deprecation", "-feature")



View it on GitLab: https://salsa.debian.org/java-team/msgpack-java/-/commit/9ec23cb23bf6b71898daef2f94b87f6cebacb69f

-- 
View it on GitLab: https://salsa.debian.org/java-team/msgpack-java/-/commit/9ec23cb23bf6b71898daef2f94b87f6cebacb69f
You're receiving this email because of your account on salsa.debian.org.


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


More information about the pkg-java-commits mailing list