Skip to content

Commit 64406f9

Browse files
authored
Do not fail compilation on cascade failure (#435)
* Avoid cascade on types already annotated * don't fail compilation on cascade error
1 parent d1229d6 commit 64406f9

File tree

21 files changed

+1137
-25
lines changed

21 files changed

+1137
-25
lines changed

blackbox-test-cascade/pom.xml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<groupId>io.avaje</groupId>
5+
<artifactId>avaje-jsonb-parent</artifactId>
6+
<version>3.8-RC1</version>
7+
</parent>
8+
<artifactId>blackbox-test-cascade</artifactId>
9+
10+
<properties>
11+
<maven.deploy.skip>true</maven.deploy.skip>
12+
<maven.compiler.release>21</maven.compiler.release>
13+
</properties>
14+
15+
<dependencies>
16+
17+
<!-- for testing fields with third party annotations -->
18+
<dependency>
19+
<groupId>javax.validation</groupId>
20+
<artifactId>validation-api</artifactId>
21+
<version>2.0.1.Final</version>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>io.avaje</groupId>
26+
<artifactId>blackbox-test</artifactId>
27+
<version>${project.version}</version>
28+
</dependency>
29+
30+
<dependency>
31+
<groupId>io.avaje</groupId>
32+
<artifactId>avaje-jsonb</artifactId>
33+
<version>${project.version}</version>
34+
</dependency>
35+
36+
37+
<dependency>
38+
<groupId>io.avaje</groupId>
39+
<artifactId>avaje-jsonb-generator</artifactId>
40+
<version>${project.version}</version>
41+
<scope>provided</scope>
42+
</dependency>
43+
44+
<!-- test dependencies -->
45+
46+
<dependency>
47+
<groupId>io.avaje</groupId>
48+
<artifactId>junit</artifactId>
49+
<version>1.6</version>
50+
<scope>test</scope>
51+
</dependency>
52+
53+
</dependencies>
54+
55+
56+
<build>
57+
<plugins>
58+
<plugin>
59+
<artifactId>maven-deploy-plugin</artifactId>
60+
<configuration>
61+
<skip>true</skip>
62+
</configuration>
63+
</plugin>
64+
<plugin>
65+
<artifactId>maven-javadoc-plugin</artifactId>
66+
<configuration>
67+
<skip>true</skip>
68+
</configuration>
69+
</plugin>
70+
</plugins>
71+
</build>
72+
73+
</project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module blackbox.test.cascade {
2+
3+
requires static io.avaje.jsonb;
4+
requires static io.avaje.spi;
5+
requires blackbox.test;
6+
7+
provides io.avaje.jsonb.spi.JsonbExtension with org.cascade.jsonb.GeneratedJsonComponent;
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package org.cascade.custom;
2+
3+
public record MagicNumber(int number) {}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.cascade.custom;
2+
3+
import io.avaje.json.JsonAdapter;
4+
import io.avaje.json.JsonReader;
5+
import io.avaje.json.JsonWriter;
6+
import io.avaje.jsonb.CustomAdapter;
7+
import io.avaje.jsonb.Jsonb;
8+
9+
@CustomAdapter
10+
public class MagicNumberAdapter implements JsonAdapter<MagicNumber> {
11+
12+
public MagicNumberAdapter(Jsonb jsonb) {}
13+
14+
@Override
15+
public void toJson(JsonWriter writer, MagicNumber value) {
16+
writer.value(value.number());
17+
}
18+
19+
@Override
20+
public MagicNumber fromJson(JsonReader reader) {
21+
return new MagicNumber(reader.readInt());
22+
}
23+
}

0 commit comments

Comments
 (0)