Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 851-compatible-defa…
Browse files Browse the repository at this point in the history
…ult-values
  • Loading branch information
theigl committed Dec 20, 2022
2 parents 2e22edc + bb10a0b commit 9796639
Show file tree
Hide file tree
Showing 146 changed files with 2,671 additions and 440 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,42 @@ jobs:
PUBLISH_ARTIFACTS: true

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'

- name: Build with JDK 11
run: mvn -B install --no-transfer-progress -DskipTests

- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: 'temurin'
java-version: 8
- name: Test with JDK 8
run: mvn -v && mvn -B test

- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Test with JDK 11
run: mvn -v && mvn -B test

- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 16
- name: Test with JDK 16
distribution: 'temurin'
java-version: 17
- name: Test with JDK 17
run: mvn -v && mvn -B test

- name: Set up settings.xml for Sonatype
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: 'temurin'
java-version: 8

- name: Publish SNAPSHOT version to Sonatype (we can skip tests, since we only deploy, if the build workflow succeeded)
run: mvn -v && mvn -B -P requireSnapshot --no-transfer-progress -DskipTests deploy --settings build/settings-sonatype.xml
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,33 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'

- name: Build with JDK 11
run: mvn -B install --no-transfer-progress -DskipTests

- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: 'temurin'
java-version: 8
- name: Test with JDK 8
run: mvn -v && mvn -B test

- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Test with JDK 11
run: mvn -v && mvn -B test

- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 16
- name: Test with JDK 16
distribution: 'temurin'
java-version: 17
- name: Test with JDK 17
run: mvn -v && mvn -B test
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2008-2020, Nathan Sweet
Copyright (c) 2008-2022, Nathan Sweet
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Please use the [Kryo mailing list](https://groups.google.com/forum/#!forum/kryo-
- [Installation](#installation)
* [With Maven](#with-maven)
* [Without Maven](#without-maven)
* [On Android](#on-android)
* [Building from source](#building-from-source)
- [Quickstart](#quickstart)
- [IO](#io)
Expand Down Expand Up @@ -89,6 +88,8 @@ Please use the [Kryo mailing list](https://groups.google.com/forum/#!forum/kryo-

## Recent releases

* [5.3.0](https://github.com/EsotericSoftware/kryo/releases/tag/kryo-parent-5.3.0) - brings bug fixes and performance improvements.
* [5.2.1](https://github.com/EsotericSoftware/kryo/releases/tag/kryo-parent-5.2.1) - brings minor bug fixes and improvements.
* [5.2.0](https://github.com/EsotericSoftware/kryo/releases/tag/kryo-parent-5.2.0) - brings bug fixes for `RecordSerializer` and improvements. Important: If you are currently storing serialized `java.util.Record`, please see the [release notes](https://github.com/EsotericSoftware/kryo/releases/tag/kryo-parent-5.2.0) for upgrade instructions.
* [5.1.1](https://github.com/EsotericSoftware/kryo/releases/tag/kryo-parent-5.1.1) - brings bug fixes for `CompatibleFieldSerializer` and removes dependency from versioned artifact
* [5.1.0](https://github.com/EsotericSoftware/kryo/releases/tag/kryo-parent-5.1.0) - brings support for `java.util.Record` and improved support for older Android versions
Expand All @@ -110,7 +111,7 @@ To use the latest Kryo release in your application, use this dependency entry in
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
<version>5.2.0</version>
<version>5.3.0</version>
</dependency>
```

Expand All @@ -120,7 +121,7 @@ To use the latest Kryo release in a library you want to publish, use this depend
<dependency>
<groupId>com.esotericsoftware.kryo</groupId>
<artifactId>kryo5</artifactId>
<version>5.2.0</version>
<version>5.3.0</version>
</dependency>
```

Expand All @@ -137,31 +138,20 @@ To use the latest Kryo snapshot, use:
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
</dependency>
<!-- for usage in a library that should be published: -->
<dependency>
<groupId>com.esotericsoftware.kryo</groupId>
<artifactId>kryo5</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
</dependency>
```

### Without Maven

Not everyone is a Maven fan. Using Kryo without Maven requires placing the [Kryo JAR](#installation) on your classpath along with the dependency JARs found in [lib](https://github.com/EsotericSoftware/kryo/tree/master/lib).

### On Android

Kryo 5 **before 5.1.0** ships with Objenesis 3.1 which [currently supports](https://github.com/easymock/objenesis/issues/79) Android API >= 26. If you want to use these versions of Kryo with older Android APIs, you need to explicitely depend on Objensis 3.2.

```
implementation ('com.esotericsoftware:kryo:5.0.4') {
exclude group: "org.objenesis"
}
implementation 'org.objenesis:objenesis:3.2'
```

### Building from source

Building Kryo from source requires JDK11+ and Maven. To build all artifacts, run:
Expand Down Expand Up @@ -627,12 +617,11 @@ Kryo `isFinal` is used to determine if a class is final. This method can be over

Kryo can serialize Java 8+ closures that implement java.io.Serializable, with some caveats. Closures serialized on one JVM may fail to be deserialized on a different JVM.

Kryo `isClosure` is used to determine if a class is a closure. If so, then ClosureSerializer.Closure is used to find the class registration instead of the closure's class. To serialize closures, the following classes must be registered: ClosureSerializer.Closure, SerializedLambda, Object[], and Class. Additionally, the closure's capturing class must be registered.
Kryo `isClosure` is used to determine if a class is a closure. If so, then ClosureSerializer.Closure is used to find the class registration instead of the closure's class. To serialize closures, the following classes must be registered: ClosureSerializer.Closure, Object[], and Class. Additionally, the closure's capturing class must be registered.

```java
kryo.register(Object[].class);
kryo.register(Class.class);
kryo.register(SerializedLambda.class);
kryo.register(ClosureSerializer.Closure.class, new ClosureSerializer());
kryo.register(CapturingClass.class);

Expand Down Expand Up @@ -1247,7 +1236,7 @@ outputPool.free(output);
```java
Pool<Input> inputPool = new Pool<Input>(true, false, 16) {
protected Input create () {
return new Input(1024, -1);
return new Input(1024);
}
};

Expand Down Expand Up @@ -1306,6 +1295,8 @@ There are a number of projects using Kryo. A few are listed below. Please submit
- [DestroyAllHumans](https://code.google.com/p/destroyallhumans/) (controls a [robot](http://www.youtube.com/watch?v=ZeZ3R38d3Cg)!)
- [Mybatis Redis-Cache](https://github.com/mybatis/redis-cache) (MyBatis Redis Cache adapter)
- [Apache Dubbo](https://github.com/apache/incubator-dubbo) (high performance, open source RPC framework)
- [Spring Statemachine](https://spring.io/projects/spring-statemachine) (State machine concepts with Spring)
- [session-compatible-fast-serializer](https://github.com/alibaba/session-compatible-fast-serializer) (A compatible field serializer with better performance)

### Scala

Expand Down
Binary file added benchmarks/lib/byte-buddy-1.12.7.jar
Binary file not shown.
13 changes: 10 additions & 3 deletions benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo-parent</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -16,7 +16,8 @@

<properties>
<kryo.root>${basedir}/..</kryo.root>
<jmh.version>1.20</jmh.version>
<jmh.version>1.36</jmh.version>
<byte-buddy.version>1.12.18</byte-buddy.version>
<uberjar.name>benchmarks</uberjar.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand All @@ -38,13 +39,19 @@
<version>${jmh.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>build-classpath</id>
Expand All @@ -62,7 +69,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<version>3.0.0</version>
<executions>
<execution>
<id>run-tests</id>
Expand Down
Loading

0 comments on commit 9796639

Please sign in to comment.