Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit fa5f875

Browse files
committed
Checker framework added
1 parent ffc45df commit fa5f875

131 files changed

Lines changed: 597 additions & 327 deletions

File tree

Some content is hidden

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

samples/client/3_0_3_unit_test/java/pom.xml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,20 @@
4747
<arg>-Xlint:all</arg>
4848
<arg>-J-Xss4m</arg><!-- Compiling the generated JSON.java file may require larger stack size. -->
4949
</compilerArgs>
50+
<annotationProcessorPaths>
51+
<path>
52+
<groupId>org.checkerframework</groupId>
53+
<artifactId>checker</artifactId>
54+
<version>${checker-version}</version>
55+
</path>
56+
</annotationProcessorPaths>
57+
<annotationProcessors>
58+
<annotationProcessor>
59+
org.checkerframework.checker.nullness.NullnessChecker
60+
</annotationProcessor>
61+
</annotationProcessors>
5062
</configuration>
5163
</plugin>
52-
5364
<plugin>
5465
<groupId>org.apache.maven.plugins</groupId>
5566
<artifactId>maven-enforcer-plugin</artifactId>
@@ -213,13 +224,17 @@
213224
<version>${swagger-annotations-version}</version>
214225
</dependency>
215226

216-
<!-- @Nullable annotation -->
227+
<!-- @NonNull / @Nullable annotations -->
217228
<dependency>
218-
<groupId>com.google.code.findbugs</groupId>
219-
<artifactId>jsr305</artifactId>
220-
<version>3.0.2</version>
229+
<groupId>org.checkerframework</groupId>
230+
<artifactId>checker-qual</artifactId>
231+
<version>${checker-version}</version>
232+
</dependency>
233+
<dependency>
234+
<groupId>org.checkerframework</groupId>
235+
<artifactId>checker</artifactId>
236+
<version>${checker-version}</version>
221237
</dependency>
222-
223238

224239
<!-- HTTP client: jersey-client -->
225240
<dependency>
@@ -277,6 +292,7 @@
277292
<maven.compiler.release>17</maven.compiler.release>
278293
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
279294
<swagger-annotations-version>1.6.3</swagger-annotations-version>
295+
<checker-version>3.42.0</checker-version>
280296
<jersey-version>1.19.4</jersey-version>
281297
<jackson-version>2.12.6</jackson-version>
282298
<jackson-databind-version>2.12.6.1</jackson-databind-version>

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import java.util.Map;
88
import java.util.Objects;
99
import java.util.Set;
10+
import org.checkerframework.checker.nullness.qual.NonNull;
11+
import org.checkerframework.checker.nullness.qual.Nullable;
1012
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1113
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1214
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -76,7 +78,7 @@ public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1 extend
7678
7779
Do not edit the class manually.
7880
*/
79-
private static AdditionalpropertiesAllowsASchemaWhichShouldValidate1 instance;
81+
private static @Nullable AdditionalpropertiesAllowsASchemaWhichShouldValidate1 instance = null;
8082

8183
protected AdditionalpropertiesAllowsASchemaWhichShouldValidate1() {
8284
super(new JsonSchemaInfo()

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import java.util.Objects;
1111
import java.util.Set;
1212
import java.util.UUID;
13+
import org.checkerframework.checker.nullness.qual.NonNull;
14+
import org.checkerframework.checker.nullness.qual.Nullable;
1315
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1416
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1517
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -82,7 +84,7 @@ public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema
8284
8385
Do not edit the class manually.
8486
*/
85-
private static AdditionalpropertiesAreAllowedByDefault1 instance;
87+
private static @Nullable AdditionalpropertiesAreAllowedByDefault1 instance = null;
8688

8789
protected AdditionalpropertiesAreAllowedByDefault1() {
8890
super(new JsonSchemaInfo()

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import java.util.Map;
88
import java.util.Objects;
99
import java.util.Set;
10+
import org.checkerframework.checker.nullness.qual.NonNull;
11+
import org.checkerframework.checker.nullness.qual.Nullable;
1012
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1113
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1214
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -53,7 +55,7 @@ public static class AdditionalpropertiesCanExistByItself1 extends JsonSchema imp
5355
5456
Do not edit the class manually.
5557
*/
56-
private static AdditionalpropertiesCanExistByItself1 instance;
58+
private static @Nullable AdditionalpropertiesCanExistByItself1 instance = null;
5759

5860
protected AdditionalpropertiesCanExistByItself1() {
5961
super(new JsonSchemaInfo()

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import java.util.Objects;
1111
import java.util.Set;
1212
import java.util.UUID;
13+
import org.checkerframework.checker.nullness.qual.NonNull;
14+
import org.checkerframework.checker.nullness.qual.Nullable;
1315
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1416
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1517
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -70,7 +72,7 @@ public static class Schema0MapInput {
7072

7173

7274
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, Schema0Map> {
73-
private static Schema0 instance;
75+
private static @Nullable Schema0 instance = null;
7476

7577
protected Schema0() {
7678
super(new JsonSchemaInfo()
@@ -270,7 +272,7 @@ public static class AdditionalpropertiesShouldNotLookInApplicators1 extends Json
270272
271273
Do not edit the class manually.
272274
*/
273-
private static AdditionalpropertiesShouldNotLookInApplicators1 instance;
275+
private static @Nullable AdditionalpropertiesShouldNotLookInApplicators1 instance = null;
274276

275277
protected AdditionalpropertiesShouldNotLookInApplicators1() {
276278
super(new JsonSchemaInfo()

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import java.util.Objects;
1111
import java.util.Set;
1212
import java.util.UUID;
13+
import org.checkerframework.checker.nullness.qual.NonNull;
14+
import org.checkerframework.checker.nullness.qual.Nullable;
1315
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1416
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1517
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -65,7 +67,7 @@ public static class Schema0MapInput {
6567

6668

6769
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, Schema0Map> {
68-
private static Schema0 instance;
70+
private static @Nullable Schema0 instance = null;
6971

7072
protected Schema0() {
7173
super(new JsonSchemaInfo()
@@ -272,7 +274,7 @@ public static class Schema1MapInput {
272274

273275

274276
public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, Schema1Map> {
275-
private static Schema1 instance;
277+
private static @Nullable Schema1 instance = null;
276278

277279
protected Schema1() {
278280
super(new JsonSchemaInfo()
@@ -455,7 +457,7 @@ public static class Allof1 extends JsonSchema implements NullSchemaValidator, Bo
455457
456458
Do not edit the class manually.
457459
*/
458-
private static Allof1 instance;
460+
private static @Nullable Allof1 instance = null;
459461

460462
protected Allof1() {
461463
super(new JsonSchemaInfo()

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import java.util.Objects;
1212
import java.util.Set;
1313
import java.util.UUID;
14+
import org.checkerframework.checker.nullness.qual.NonNull;
15+
import org.checkerframework.checker.nullness.qual.Nullable;
1416
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1517
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1618
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -33,7 +35,7 @@ public class AllofCombinedWithAnyofOneof {
3335

3436

3537
public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, FrozenMap<Object>> {
36-
private static Schema02 instance;
38+
private static @Nullable Schema02 instance = null;
3739

3840
protected Schema02() {
3941
super(new JsonSchemaInfo()
@@ -205,7 +207,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
205207
}
206208

207209
public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, FrozenMap<Object>> {
208-
private static Schema01 instance;
210+
private static @Nullable Schema01 instance = null;
209211

210212
protected Schema01() {
211213
super(new JsonSchemaInfo()
@@ -377,7 +379,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
377379
}
378380

379381
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, FrozenMap<Object>> {
380-
private static Schema0 instance;
382+
private static @Nullable Schema0 instance = null;
381383

382384
protected Schema0() {
383385
super(new JsonSchemaInfo()
@@ -555,7 +557,7 @@ public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements N
555557
556558
Do not edit the class manually.
557559
*/
558-
private static AllofCombinedWithAnyofOneof1 instance;
560+
private static @Nullable AllofCombinedWithAnyofOneof1 instance = null;
559561

560562
protected AllofCombinedWithAnyofOneof1() {
561563
super(new JsonSchemaInfo()

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import java.util.Objects;
1111
import java.util.Set;
1212
import java.util.UUID;
13+
import org.checkerframework.checker.nullness.qual.NonNull;
14+
import org.checkerframework.checker.nullness.qual.Nullable;
1315
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1416
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1517
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -32,7 +34,7 @@ public class AllofSimpleTypes {
3234

3335

3436
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, FrozenMap<Object>> {
35-
private static Schema0 instance;
37+
private static @Nullable Schema0 instance = null;
3638

3739
protected Schema0() {
3840
super(new JsonSchemaInfo()
@@ -204,7 +206,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
204206
}
205207

206208
public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, FrozenMap<Object>> {
207-
private static Schema1 instance;
209+
private static @Nullable Schema1 instance = null;
208210

209211
protected Schema1() {
210212
super(new JsonSchemaInfo()
@@ -382,7 +384,7 @@ public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaVa
382384
383385
Do not edit the class manually.
384386
*/
385-
private static AllofSimpleTypes1 instance;
387+
private static @Nullable AllofSimpleTypes1 instance = null;
386388

387389
protected AllofSimpleTypes1() {
388390
super(new JsonSchemaInfo()

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import java.util.Objects;
1111
import java.util.Set;
1212
import java.util.UUID;
13+
import org.checkerframework.checker.nullness.qual.NonNull;
14+
import org.checkerframework.checker.nullness.qual.Nullable;
1315
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1416
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1517
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -66,7 +68,7 @@ public static class Schema0MapInput {
6668

6769

6870
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, Schema0Map> {
69-
private static Schema0 instance;
71+
private static @Nullable Schema0 instance = null;
7072

7173
protected Schema0() {
7274
super(new JsonSchemaInfo()
@@ -273,7 +275,7 @@ public static class Schema1MapInput {
273275

274276

275277
public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, FrozenList<Object>>, MapSchemaValidator<Object, Schema1Map> {
276-
private static Schema1 instance;
278+
private static @Nullable Schema1 instance = null;
277279

278280
protected Schema1() {
279281
super(new JsonSchemaInfo()
@@ -486,7 +488,7 @@ public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchem
486488
487489
Do not edit the class manually.
488490
*/
489-
private static AllofWithBaseSchema1 instance;
491+
private static @Nullable AllofWithBaseSchema1 instance = null;
490492

491493
protected AllofWithBaseSchema1() {
492494
super(new JsonSchemaInfo()

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import java.util.Objects;
1111
import java.util.Set;
1212
import java.util.UUID;
13+
import org.checkerframework.checker.nullness.qual.NonNull;
14+
import org.checkerframework.checker.nullness.qual.Nullable;
1315
import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
1416
import org.openapijsonschematools.client.configurations.SchemaConfiguration;
1517
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
@@ -42,7 +44,7 @@ public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullS
4244
4345
Do not edit the class manually.
4446
*/
45-
private static AllofWithOneEmptySchema1 instance;
47+
private static @Nullable AllofWithOneEmptySchema1 instance = null;
4648

4749
protected AllofWithOneEmptySchema1() {
4850
super(new JsonSchemaInfo()

0 commit comments

Comments
 (0)