Skip to content

Commit d1cd32a

Browse files
authored
Add @NullMarked to all packages in tck modules (#12344)
1 parent a72ee1b commit d1cd32a

39 files changed

Lines changed: 442 additions & 72 deletions

http-client-tck/src/main/java/io/micronaut/http/client/tck/tests/Person.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package io.micronaut.http.client.tck.tests;
1717

1818
import io.micronaut.core.annotation.Introspected;
19-
import org.jspecify.annotations.NonNull;
2019
import io.micronaut.core.annotation.ReflectiveAccess;
2120
import java.util.Objects;
2221
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -25,7 +24,6 @@
2524
@ReflectiveAccess
2625
class Person {
2726

28-
@NonNull
2927
private final String name;
3028

3129
private final int age;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2017-2026 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
/**
17+
* The package info.
18+
*/
19+
@NullMarked
20+
package io.micronaut.http.client.tck.tests.filter;
21+
22+
import org.jspecify.annotations.NullMarked;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2017-2026 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
/**
17+
* The package info.
18+
*/
19+
@NullMarked
20+
package io.micronaut.http.client.tck.tests;
21+
22+
import org.jspecify.annotations.NullMarked;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2017-2026 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
/** * The package info. */
17+
@NullMarked
18+
package io.micronaut.http.server.tck; import org.jspecify.annotations.NullMarked;

http-server-tck/src/main/java/io/micronaut/http/server/tck/tests/MiscTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.fasterxml.jackson.annotation.JsonProperty;
1919
import io.micronaut.context.annotation.Requires;
2020
import io.micronaut.core.annotation.Introspected;
21-
import org.jspecify.annotations.NonNull;
2221
import io.micronaut.core.annotation.ReflectiveAccess;
2322
import io.micronaut.http.HttpHeaders;
2423
import io.micronaut.http.HttpRequest;
@@ -192,17 +191,15 @@ String getOkAsHtml() {
192191
@ReflectiveAccess
193192
static class MessageCreate {
194193

195-
@NonNull
196194
@NotBlank
197195
private final String message;
198196

199197
MessageCreate(
200-
@JsonProperty("message") @NonNull String message // @JsonProperty annotation for Jackson Databind
198+
@JsonProperty("message") String message // @JsonProperty annotation for Jackson Databind
201199
) {
202200
this.message = message;
203201
}
204202

205-
@NonNull
206203
String getMessage() {
207204
return message;
208205
}
@@ -212,15 +209,13 @@ String getMessage() {
212209
@ReflectiveAccess
213210
static class MyResponse {
214211

215-
@NonNull
216212
@NotBlank
217213
private final String greeting;
218214

219-
public MyResponse(@NonNull String greeting) {
215+
public MyResponse(String greeting) {
220216
this.greeting = greeting;
221217
}
222218

223-
@NonNull
224219
public String getGreeting() {
225220
return greeting;
226221
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2017-2026 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
/** * The package info. */
17+
@NullMarked
18+
package io.micronaut.http.server.tck.tests.binding; import org.jspecify.annotations.NullMarked;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2017-2026 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
/** * The package info. */
17+
@NullMarked
18+
package io.micronaut.http.server.tck.tests.bodywritable; import org.jspecify.annotations.NullMarked;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2017-2026 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
/** * The package info. */
17+
@NullMarked
18+
package io.micronaut.http.server.tck.tests.codec; import org.jspecify.annotations.NullMarked;

http-server-tck/src/main/java/io/micronaut/http/server/tck/tests/constraintshandler/ControllerConstraintHandlerTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.fasterxml.jackson.annotation.JsonProperty;
1919
import io.micronaut.context.annotation.Requires;
2020
import io.micronaut.core.annotation.Introspected;
21-
import org.jspecify.annotations.NonNull;
2221
import org.jspecify.annotations.Nullable;
2322
import io.micronaut.core.annotation.ReflectiveAccess;
2423
import io.micronaut.core.type.Argument;
@@ -259,26 +258,22 @@ public String getPassword() {
259258
static class CredentialsWithNonNull {
260259
@NotBlank
261260
@Email
262-
@NonNull
263261
private final String username;
264262

265263
@NotBlank
266-
@NonNull
267264
private final String password;
268265

269-
CredentialsWithNonNull(@JsonProperty("username") @NonNull String username, // @JsonProperty for JacksonDatabind
270-
@JsonProperty("password") @NonNull String password // @JsonProperty for JacksonDatabind
266+
CredentialsWithNonNull(@JsonProperty("username") String username, // @JsonProperty for JacksonDatabind
267+
@JsonProperty("password") String password // @JsonProperty for JacksonDatabind
271268
) {
272269
this.username = username;
273270
this.password = password;
274271
}
275272

276-
@NonNull
277273
public String getUsername() {
278274
return username;
279275
}
280276

281-
@NonNull
282277
public String getPassword() {
283278
return password;
284279
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2017-2026 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
/** * The package info. */
17+
@NullMarked
18+
package io.micronaut.http.server.tck.tests.constraintshandler; import org.jspecify.annotations.NullMarked;

0 commit comments

Comments
 (0)