Skip to content

Commit 8ef542c

Browse files
committed
Merge branch 'main' into java8-backport
2 parents 7596384 + e4a60d9 commit 8ef542c

File tree

117 files changed

+2180
-1928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+2180
-1928
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ updates:
1111
- "*"
1212
labels:
1313
- "dependencies"
14-
target-branch: "master"
14+
target-branch: "main"
1515

1616
- package-ecosystem: "github-actions"
1717
directory: "/"
@@ -22,4 +22,4 @@ updates:
2222
prefix: "[workflow]"
2323
labels:
2424
- "dependencies"
25-
target-branch: "master"
25+
target-branch: "main"

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
os: [ubuntu-latest]
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Set up Java
21-
uses: actions/setup-java@v3
21+
uses: actions/setup-java@v4
2222
with:
2323
java-version: ${{ matrix.java_version }}
2424
distribution: 'zulu'
2525
- name: Maven cache
26-
uses: actions/cache@v3
26+
uses: actions/cache@v4
2727
env:
2828
cache-name: maven-cache
2929
with:

.github/workflows/dependabot-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- name: Dependabot metadata
1414
id: metadata
15-
uses: dependabot/fetch-metadata@v1
15+
uses: dependabot/fetch-metadata@v2
1616
with:
1717
github-token: "${{ secrets.GITHUB_TOKEN }}"
1818
- name: Approve a PR

.github/workflows/jdk-ea-stable.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
packages: write
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Set up Java
2121
uses: oracle-actions/setup-java@v1
2222
with:
2323
website: jdk.java.net
2424
release: ea
2525
version: stable
2626
- name: Maven cache
27-
uses: actions/cache@v3
27+
uses: actions/cache@v4
2828
env:
2929
cache-name: maven-cache
3030
with:

.github/workflows/jdk-ea.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ jobs:
2222
os: [ubuntu-latest]
2323

2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626
- name: Set up Java
2727
uses: oracle-actions/setup-java@v1
2828
with:
2929
website: jdk.java.net
3030
release: ${{ matrix.java_version }}
3131
- name: Maven cache
32-
uses: actions/cache@v3
32+
uses: actions/cache@v4
3333
env:
3434
cache-name: maven-cache
3535
with:

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ For types we cannot annotate with `@Json` we can place `@Json.Import(TypeToimpor
9595

9696
```java
9797
// build using defaults
98-
Jsonb jsonb = Jsonb.builder().build();
98+
Jsonb jsonb = Jsonb.instance();
9999

100100
JsonType<Customer> customerType = jsonb.type(Customer.class);
101101

@@ -116,7 +116,7 @@ to include when serializing to json.
116116
For example:
117117

118118
```java
119-
Jsonb jsonb = Jsonb.builder().build();
119+
Jsonb jsonb = Jsonb.instance();
120120

121121
JsonType<Customer> customerType = jsonb.type(Customer.class);
122122

@@ -226,7 +226,7 @@ public final class AddressJsonAdapter implements JsonAdapter<Address>, ViewBuild
226226

227227
## Based on Moshi
228228

229-
`avaje-jsonb` is based on [Moshi](https://github.com/square/moshi) with some changes as summarised below:
229+
`avaje-jsonb` was based on [Moshi](https://github.com/square/moshi) with some changes as summarised below:
230230

231231
#### Changes from Moshi
232232
- Generates Java source code (rather than Kotlin)
@@ -245,7 +245,6 @@ public final class AddressJsonAdapter implements JsonAdapter<Address>, ViewBuild
245245
- Add `@Json.Import` to generate adapters for types that we can't put the annotation on (types we might not 'own')
246246
- Add Mixin feature similar to Jackson Mixins
247247
- Add Types.listOf(), Types.setOf(), Types.mapOf() helper methods
248-
- Provide an SPI with the view to target other json-p implementations JSONP/Yasson, GSON, etc
249248
- Adds more common Java types with default built-in support - java.time types, java.util.UUID
250249
- Adds support for json views
251250

blackbox-test/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.avaje</groupId>
66
<artifactId>avaje-jsonb-parent</artifactId>
7-
<version>3.1-SNAPSHOT</version>
7+
<version>3.6</version>
88
</parent>
99

1010
<artifactId>blackbox-test</artifactId>
@@ -28,13 +28,13 @@
2828
<dependency>
2929
<groupId>io.avaje</groupId>
3030
<artifactId>avaje-jsonb</artifactId>
31-
<version>3.1-SNAPSHOT</version>
31+
<version>3.6</version>
3232
</dependency>
3333

3434
<dependency>
3535
<groupId>io.avaje</groupId>
3636
<artifactId>avaje-json-node</artifactId>
37-
<version>3.1-SNAPSHOT</version>
37+
<version>3.6</version>
3838
</dependency>
3939

4040
<!-- <dependency>-->
@@ -45,7 +45,7 @@
4545
<dependency>
4646
<groupId>io.avaje</groupId>
4747
<artifactId>avaje-inject</artifactId>
48-
<version>10.3</version>
48+
<version>11.5</version>
4949
<scope>provided</scope>
5050
<optional>true</optional>
5151
</dependency>
@@ -54,13 +54,13 @@
5454
<dependency>
5555
<groupId>io.avaje</groupId>
5656
<artifactId>avaje-jsonb-generator</artifactId>
57-
<version>3.1-SNAPSHOT</version>
57+
<version>3.6</version>
5858
<scope>provided</scope>
5959
</dependency>
6060
<dependency>
6161
<groupId>io.avaje</groupId>
6262
<artifactId>avaje-inject-generator</artifactId>
63-
<version>10.3</version>
63+
<version>11.5</version>
6464
<scope>provided</scope>
6565
<optional>true</optional>
6666
</dependency>
@@ -69,7 +69,7 @@
6969
<dependency>
7070
<groupId>io.avaje</groupId>
7171
<artifactId>junit</artifactId>
72-
<version>1.5</version>
72+
<version>1.6</version>
7373
<scope>test</scope>
7474
</dependency>
7575

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
import io.avaje.jsonb.spi.JsonbExtension;
2+
13
module blackbox.test {
24

35
requires static io.avaje.jsonb;
46
requires static io.avaje.spi;
57
requires java.validation;
68
requires io.avaje.json.node;
79

8-
provides io.avaje.jsonb.spi.JsonbExtension with org.example.customer.customtype.CustomTypeComponent, org.example.jsonb.GeneratedJsonComponent;
10+
provides JsonbExtension
11+
with
12+
org.example.customer.customtype.CustomTypeComponent,
13+
org.example.other.custom.CustomJsonComponent,
14+
org.example.jsonb.GeneratedJsonComponent,
15+
org.example.pkg_private.PkgPrivateJsonComponent;
916

1017
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.example.customer.datetime;
2+
3+
import io.avaje.jsonb.Json;
4+
5+
import java.util.Calendar;
6+
7+
@Json
8+
public record MyCalData(Calendar cal) {
9+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package org.example.customer.jaxb;
2+
3+
import io.avaje.jsonb.Json;
4+
5+
import java.util.*;
6+
7+
@Json
8+
public class MyJaxbType {
9+
10+
private String name;
11+
12+
private List<String> tags;
13+
private Set<String> tags2;
14+
private Collection<Long> tags3;
15+
16+
17+
public String name() {
18+
return name;
19+
}
20+
21+
public MyJaxbType setName(String name) {
22+
this.name = name;
23+
return this;
24+
}
25+
26+
public List<String> getTags() {
27+
if (tags == null) {
28+
tags = new ArrayList<>();
29+
}
30+
return tags;
31+
}
32+
33+
public Set<String> getTags2() {
34+
if (tags2 == null) {
35+
tags2 = new LinkedHashSet<>();
36+
}
37+
return tags2;
38+
}
39+
40+
public Collection<Long> getTags3() {
41+
if (tags3 == null) {
42+
tags3 = new TreeSet<>();
43+
}
44+
return tags3;
45+
}
46+
}

0 commit comments

Comments
 (0)