Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,3 @@ jobs:
env:
TEST_JAVA_HOME: ${{ steps.target-jdk.outputs.path }}
run: ./sbt test
- name: Universal Buffer Test
env:
TEST_JAVA_HOME: ${{ steps.target-jdk.outputs.path }}
run: ./sbt test -J-Dmsgpack.universal-buffer=true
15 changes: 1 addition & 14 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ MessagePack-Java is a binary serialization library that provides a fast and comp
./sbt ~test # Run tests continuously on file changes
./sbt testOnly *TestClass # Run specific test class
./sbt "testOnly *TestClass -- -z pattern" # Run tests matching pattern

# Test with universal buffer mode (for compatibility testing)
./sbt test -J-Dmsgpack.universal-buffer=true
```

### Code Quality
Expand Down Expand Up @@ -53,9 +50,7 @@ Key locations:

### Buffer Management System
MessagePack uses an efficient buffer abstraction layer:
- **MessageBuffer**: Platform-optimized buffer implementations
- Uses `sun.misc.Unsafe` for performance when available
- Falls back to ByteBuffer on restricted platforms
- **MessageBuffer**: ByteBuffer-based memory abstraction (no `sun.misc.Unsafe` or other JDK-internal APIs)
- **MessageBufferInput/Output**: Manages buffer sequences for streaming

### Jackson Integration
Expand All @@ -71,14 +66,6 @@ The msgpack-jackson module provides:
- **msgpack-jackson tests**: Written in Java using JUnit
- Location: `msgpack-jackson/src/test/java/`

## Important JVM Options

For JDK 17+ compatibility, these options are automatically added:
```
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
```

## Code Style Requirements
- Java code follows Facebook Presto style (enforced by checkstyle)
- Scala test code uses Scalafmt with Scala 3 dialect and 100 character line limit
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ dependencies {

- [Usage examples](https://github.com/msgpack/msgpack-java/blob/develop/msgpack-core/src/test/java/org/msgpack/core/example/MessagePackExample.java)

### Java 17 Support

For using DirectByteBuffer (off-heap memory access methods) in JDK17, you need to specify two JVM options:
```
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
```


### Integration with Jackson ObjectMapper (jackson-databind)

msgpack-java supports serialization and deserialization of Java objects through [jackson-databind](https://github.com/FasterXML/jackson-databind).
Expand Down
13 changes: 2 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ val buildSettings = Seq[Setting[?]](
// -release 8 pins scalac's resolution of JDK API calls to the JDK8 surface (e.g.
// test code calling ByteBuffer.flip() resolves to the inherited Buffer.flip():Buffer
// rather than JDK9's covariant ByteBuffer.flip():ByteBuffer override, which doesn't
// exist on a real JDK8 at runtime -> NoSuchMethodError). Unlike javac's --release,
// this doesn't need an ignore-symbol-file escape hatch since test code never touches
// JDK-internal APIs the way the main sources' Unsafe usage does.
// exist on a real JDK8 at runtime -> NoSuchMethodError).
scalacOptions ++=
Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-feature", "-release", "8"),
Test / javaOptions ++= Seq("-ea"),
Expand Down Expand Up @@ -144,15 +142,8 @@ lazy val msgpackCore = Project(id = "msgpack-core", base = file("msgpack-core"))
"org.msgpack.value",
"org.msgpack.value.impl"
),
OsgiKeys.importPackage := Seq("!android.os", "!sun.*"),
OsgiKeys.importPackage := Seq("!android.os"),
testFrameworks += new TestFramework("wvlet.airspec.Framework"),
Test / javaOptions ++=
Seq(
// --add-opens is not available in JDK8
"-XX:+IgnoreUnrecognizedVMOptions",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
),
libraryDependencies ++=
Seq(
// msgpack-core should have no external dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ public void readPayload(ByteBuffer dst)
*
* <p>
* This consumes bytes, copies them to the specified buffer
* This is usually faster than readPayload(ByteBuffer) by using unsafe.copyMemory
* This is usually faster than readPayload(ByteBuffer)
*
* @param dst the Message buffer into which the data is read
* @param off the offset in the Message buffer
Expand Down
Loading