mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-08 18:41:37 +00:00
Upgrade to Nullability Plugin 0.0.9
Closes gh-48638
This commit is contained in:
+5
@@ -30,18 +30,23 @@ public class City implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.batch.jdbc.autoconfigure.domain;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+2
@@ -29,8 +29,10 @@ import org.springframework.data.cassandra.core.mapping.Table;
|
||||
public class ExampleEntity {
|
||||
|
||||
@PrimaryKey
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String id;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String description;
|
||||
|
||||
public String getId() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.test.autoconfigure.data.cassandra;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+12
-10
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.data.cassandra.domain.city;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.data.cassandra.core.mapping.CassandraType;
|
||||
import org.springframework.data.cassandra.core.mapping.CassandraType.Name;
|
||||
import org.springframework.data.cassandra.core.mapping.Column;
|
||||
@@ -27,21 +29,21 @@ public class City {
|
||||
|
||||
@PrimaryKey
|
||||
@CassandraType(type = Name.BIGINT)
|
||||
private Long id;
|
||||
private @Nullable Long id;
|
||||
|
||||
@Column
|
||||
private String name;
|
||||
private @Nullable String name;
|
||||
|
||||
@Column
|
||||
private String state;
|
||||
private @Nullable String state;
|
||||
|
||||
@Column
|
||||
private String country;
|
||||
private @Nullable String country;
|
||||
|
||||
@Column
|
||||
private String map;
|
||||
private @Nullable String map;
|
||||
|
||||
public Long getId() {
|
||||
public @Nullable Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@@ -49,7 +51,7 @@ public class City {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
public @Nullable String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@@ -57,7 +59,7 @@ public class City {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
public @Nullable String getState() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
@@ -65,7 +67,7 @@ public class City {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
public @Nullable String getCountry() {
|
||||
return this.country;
|
||||
}
|
||||
|
||||
@@ -73,7 +75,7 @@ public class City {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getMap() {
|
||||
public @Nullable String getMap() {
|
||||
return this.map;
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.cassandra.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.cassandra.domain.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+3
-1
@@ -16,12 +16,14 @@
|
||||
|
||||
package org.springframework.boot.data.domain.city;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
public class City {
|
||||
|
||||
@Id
|
||||
private Long id;
|
||||
private @Nullable Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+4
-2
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.data.couchbase.domain.city;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.couchbase.core.mapping.Document;
|
||||
import org.springframework.data.couchbase.core.mapping.Field;
|
||||
@@ -24,9 +26,9 @@ import org.springframework.data.couchbase.core.mapping.Field;
|
||||
public class City {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
private @Nullable String id;
|
||||
|
||||
@Field
|
||||
private String name;
|
||||
private @Nullable String name;
|
||||
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.couchbase.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.couchbase.domain.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.elasticsearch.domain.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
@@ -29,14 +29,19 @@ public class City implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.elasticsearch.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
@@ -23,14 +23,19 @@ import org.springframework.data.relational.core.mapping.Table;
|
||||
public class City {
|
||||
|
||||
@Id
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.jdbc.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.jdbc.domain.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
@@ -30,18 +30,23 @@ public class City implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.jpa.autoconfigure.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+2
@@ -31,10 +31,12 @@ public class Country implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@Audited
|
||||
@Column
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
public Long getId() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.jpa.autoconfigure.domain.country;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.ldap.autoconfigure.domain.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+4
-2
@@ -18,6 +18,8 @@ package org.springframework.boot.data.ldap.autoconfigure.domain.person;
|
||||
|
||||
import javax.naming.Name;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.ldap.odm.annotations.Attribute;
|
||||
import org.springframework.ldap.odm.annotations.DnAttribute;
|
||||
import org.springframework.ldap.odm.annotations.Entry;
|
||||
@@ -27,10 +29,10 @@ import org.springframework.ldap.odm.annotations.Id;
|
||||
public class Person {
|
||||
|
||||
@Id
|
||||
private Name dn;
|
||||
private @Nullable Name dn;
|
||||
|
||||
@Attribute(name = "cn")
|
||||
@DnAttribute(value = "cn", index = 1)
|
||||
private String fullName;
|
||||
private @Nullable String fullName;
|
||||
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.ldap.autoconfigure.domain.person;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.mongodb.alt;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+4
@@ -25,12 +25,16 @@ public class City implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.mongodb.autoconfigure.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+1
@@ -25,6 +25,7 @@ public class Country implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
protected Country() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.mongodb.autoconfigure.domain.country;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.mongodb.autoconfigure.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
@@ -30,14 +30,19 @@ public class City implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private final String name;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private final Country country;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
public City(String name, Country country) {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.neo4j.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+1
@@ -29,6 +29,7 @@ public class Country implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
private final String name;
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.neo4j.domain.country;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.neo4j.domain.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+1
@@ -25,6 +25,7 @@ public class TestNode {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ public class TestNonAnnotated {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ public class TestPersistent {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ public class TestRelationshipProperties {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
Long id;
|
||||
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.neo4j.domain.scan;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
@@ -23,14 +23,19 @@ import org.springframework.data.relational.core.mapping.Table;
|
||||
public class City {
|
||||
|
||||
@Id
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.r2dbc.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.r2dbc.domain.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
@@ -27,14 +27,19 @@ public class City implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.redis.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.redis.domain.empty;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
@@ -30,18 +30,23 @@ public class City implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.data.rest.domain.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package com.example;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+13
-4
@@ -27,11 +27,13 @@ import net.bytebuddy.description.modifier.Visibility;
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
import net.bytebuddy.implementation.FixedValue;
|
||||
import org.awaitility.Awaitility;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
|
||||
import org.springframework.boot.testsupport.BuildOutput;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -50,32 +52,39 @@ abstract class AbstractDevToolsIntegrationTests {
|
||||
protected final JvmLauncher javaLauncher = new JvmLauncher();
|
||||
|
||||
@TempDir
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
protected static File temp;
|
||||
|
||||
protected LaunchedApplication launchedApplication;
|
||||
private @Nullable LaunchedApplication launchedApplication;
|
||||
|
||||
protected void launchApplication(ApplicationLauncher applicationLauncher, String... args) throws Exception {
|
||||
protected LaunchedApplication launchApplication(ApplicationLauncher applicationLauncher, String... args)
|
||||
throws Exception {
|
||||
this.serverPortFile.delete();
|
||||
this.launchedApplication = applicationLauncher.launchApplication(this.javaLauncher, this.serverPortFile, args);
|
||||
return this.launchedApplication;
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void stopApplication() throws InterruptedException {
|
||||
Assert.notNull(this.launchedApplication, "Application has not been launched");
|
||||
this.launchedApplication.stop();
|
||||
}
|
||||
|
||||
protected int awaitServerPort() throws Exception {
|
||||
LaunchedApplication launchedApplication = this.launchedApplication;
|
||||
Assert.notNull(launchedApplication, "Application has not been launched");
|
||||
int port = Awaitility.waitAtMost(Duration.ofMinutes(3))
|
||||
.until(() -> new ApplicationState(this.serverPortFile, this.launchedApplication),
|
||||
.until(() -> new ApplicationState(this.serverPortFile, launchedApplication),
|
||||
ApplicationState::hasServerPort)
|
||||
.getServerPort();
|
||||
this.serverPortFile.delete();
|
||||
this.launchedApplication.restartRemote(port);
|
||||
launchedApplication.restartRemote(port);
|
||||
Thread.sleep(1000);
|
||||
return port;
|
||||
}
|
||||
|
||||
protected ControllerBuilder controller(String name) {
|
||||
Assert.notNull(this.launchedApplication, "Application has not been launched");
|
||||
return new ControllerBuilder(name, this.launchedApplication.getClassesDirectory());
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -19,7 +19,10 @@ package org.springframework.boot.devtools.tests;
|
||||
import java.io.File;
|
||||
import java.time.Instant;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.devtools.tests.JvmLauncher.LaunchedJvm;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* State of an application.
|
||||
@@ -30,7 +33,7 @@ final class ApplicationState {
|
||||
|
||||
private final Instant launchTime;
|
||||
|
||||
private final Integer serverPort;
|
||||
private final @Nullable Integer serverPort;
|
||||
|
||||
private final FileContents out;
|
||||
|
||||
@@ -56,6 +59,7 @@ final class ApplicationState {
|
||||
}
|
||||
|
||||
int getServerPort() {
|
||||
Assert.notNull(this.serverPort, "No server port is available");
|
||||
return this.serverPort;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -125,10 +125,10 @@ class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
|
||||
@ParameterizedTest(name = "{0}")
|
||||
@MethodSource("parameters")
|
||||
void deleteAController(ApplicationLauncher applicationLauncher) throws Exception {
|
||||
launchApplication(applicationLauncher);
|
||||
LaunchedApplication launchedApplication = launchApplication(applicationLauncher);
|
||||
String urlBase = "http://localhost:" + awaitServerPort();
|
||||
assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one");
|
||||
assertThat(new File(this.launchedApplication.getClassesDirectory(), "com/example/ControllerOne.class").delete())
|
||||
assertThat(new File(launchedApplication.getClassesDirectory(), "com/example/ControllerOne.class").delete())
|
||||
.isTrue();
|
||||
urlBase = "http://localhost:" + awaitServerPort();
|
||||
assertThat(this.template.getForEntity(urlBase + "/one", String.class).getStatusCode())
|
||||
@@ -139,7 +139,7 @@ class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
|
||||
@ParameterizedTest(name = "{0}")
|
||||
@MethodSource("parameters")
|
||||
void createAControllerAndThenDeleteIt(ApplicationLauncher applicationLauncher) throws Exception {
|
||||
launchApplication(applicationLauncher);
|
||||
LaunchedApplication launchedApplication = launchApplication(applicationLauncher);
|
||||
String urlBase = "http://localhost:" + awaitServerPort();
|
||||
assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one");
|
||||
assertThat(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode())
|
||||
@@ -148,7 +148,7 @@ class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests {
|
||||
urlBase = "http://localhost:" + awaitServerPort();
|
||||
assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one");
|
||||
assertThat(this.template.getForObject(urlBase + "/two", String.class)).isEqualTo("two");
|
||||
assertThat(new File(this.launchedApplication.getClassesDirectory(), "com/example/ControllerTwo.class").delete())
|
||||
assertThat(new File(launchedApplication.getClassesDirectory(), "com/example/ControllerTwo.class").delete())
|
||||
.isTrue();
|
||||
urlBase = "http://localhost:" + awaitServerPort();
|
||||
assertThat(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode())
|
||||
|
||||
+5
-3
@@ -21,6 +21,8 @@ import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
/**
|
||||
@@ -36,11 +38,11 @@ class FileContents {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
String get() {
|
||||
@Nullable String get() {
|
||||
return get(Function.identity());
|
||||
}
|
||||
|
||||
<T> T get(Function<String, T> transformer) {
|
||||
<T> @Nullable T get(Function<String, T> transformer) {
|
||||
if ((!this.file.exists()) || this.file.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
@@ -53,7 +55,7 @@ class FileContents {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public @Nullable String toString() {
|
||||
return get();
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -24,6 +24,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.junit.jupiter.api.extension.BeforeTestExecutionCallback;
|
||||
import org.junit.jupiter.api.extension.Extension;
|
||||
import org.junit.jupiter.api.extension.ExtensionContext;
|
||||
@@ -43,7 +44,7 @@ class JvmLauncher implements BeforeTestExecutionCallback {
|
||||
|
||||
private final BuildOutput buildOutput = new BuildOutput(getClass());
|
||||
|
||||
private File outputDirectory;
|
||||
private @Nullable File outputDirectory;
|
||||
|
||||
@Override
|
||||
public void beforeTestExecution(ExtensionContext context) throws Exception {
|
||||
|
||||
+6
-4
@@ -20,6 +20,8 @@ import java.io.File;
|
||||
import java.time.Instant;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* An application launched by {@link ApplicationLauncher}.
|
||||
*
|
||||
@@ -35,14 +37,14 @@ class LaunchedApplication {
|
||||
|
||||
private final Process localProcess;
|
||||
|
||||
private Process remoteProcess;
|
||||
private @Nullable Process remoteProcess;
|
||||
|
||||
private final Instant launchTime = Instant.now();
|
||||
|
||||
private final BiFunction<Integer, File, Process> remoteProcessRestarter;
|
||||
private final @Nullable BiFunction<Integer, File, Process> remoteProcessRestarter;
|
||||
|
||||
LaunchedApplication(File classesDirectory, File standardOut, File standardError, Process localProcess,
|
||||
Process remoteProcess, BiFunction<Integer, File, Process> remoteProcessRestarter) {
|
||||
@Nullable Process remoteProcess, @Nullable BiFunction<Integer, File, Process> remoteProcessRestarter) {
|
||||
this.classesDirectory = classesDirectory;
|
||||
this.standardOut = standardOut;
|
||||
this.standardError = standardError;
|
||||
@@ -63,7 +65,7 @@ class LaunchedApplication {
|
||||
stop(this.remoteProcess);
|
||||
}
|
||||
|
||||
private void stop(Process process) throws InterruptedException {
|
||||
private void stop(@Nullable Process process) throws InterruptedException {
|
||||
if (process != null) {
|
||||
process.destroy();
|
||||
process.waitFor();
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.devtools.tests;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+4
-2
@@ -24,6 +24,8 @@ import java.util.Deque;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -105,11 +107,11 @@ public class MockClientHttpRequestFactory implements ClientHttpRequestFactory {
|
||||
|
||||
private final int delay;
|
||||
|
||||
private final byte[] payload;
|
||||
private final byte @Nullable [] payload;
|
||||
|
||||
private final HttpStatus status;
|
||||
|
||||
Response(int delay, byte[] payload, HttpStatus status) {
|
||||
Response(int delay, byte @Nullable [] payload, HttpStatus status) {
|
||||
this.delay = delay;
|
||||
this.payload = payload;
|
||||
this.status = status;
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.devtools.test;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+6
-2
@@ -18,6 +18,8 @@ package org.springframework.boot.loader.launch;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Fake launcher in the {@code org.springframework.boot.loader.launch} package used in
|
||||
* {@code MainMethodTests}.
|
||||
@@ -26,13 +28,15 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
public final class FakeJarLauncher {
|
||||
|
||||
public static Consumer<String[]> action;
|
||||
public static @Nullable Consumer<String[]> action;
|
||||
|
||||
private FakeJarLauncher() {
|
||||
}
|
||||
|
||||
public static void main(String... args) {
|
||||
action.accept(args);
|
||||
if (action != null) {
|
||||
action.accept(args);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.loader.launch;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+8
-4
@@ -16,6 +16,10 @@
|
||||
|
||||
package org.springframework.boot.gson.autoconfigure.jsontest.app;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Example object to read/write as JSON.
|
||||
*
|
||||
@@ -23,9 +27,9 @@ package org.springframework.boot.gson.autoconfigure.jsontest.app;
|
||||
*/
|
||||
public class ExampleBasicObject {
|
||||
|
||||
private String value;
|
||||
private @Nullable String value;
|
||||
|
||||
public String getValue() {
|
||||
public @Nullable String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@@ -36,14 +40,14 @@ public class ExampleBasicObject {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj != null && obj.getClass() == getClass()) {
|
||||
return this.value.equals(((ExampleBasicObject) obj).value);
|
||||
return Objects.equals(this.value, ((ExampleBasicObject) obj).value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.value.hashCode();
|
||||
return Objects.hashCode(this.value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.gson.autoconfigure.jsontest.app;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.gson.autoconfigure.jsontest;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+2
@@ -23,8 +23,10 @@ package org.springframework.boot.hibernate.autoconfigure.mapping;
|
||||
*/
|
||||
public class NonAnnotatedEntity {
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String item;
|
||||
|
||||
protected NonAnnotatedEntity() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.hibernate.autoconfigure.mapping;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
@@ -32,18 +32,23 @@ public class City implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String state;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String country;
|
||||
|
||||
@Column(nullable = false)
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String map;
|
||||
|
||||
protected City() {
|
||||
|
||||
+2
-1
@@ -17,13 +17,14 @@
|
||||
package org.springframework.boot.hibernate.autoconfigure.test.city;
|
||||
|
||||
import jakarta.persistence.PostLoad;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
||||
public class CityListener {
|
||||
|
||||
private ConfigurableBeanFactory beanFactory;
|
||||
private @Nullable ConfigurableBeanFactory beanFactory;
|
||||
|
||||
public CityListener() {
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.hibernate.autoconfigure.test.city;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+2
@@ -31,10 +31,12 @@ public class Country implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private Long id;
|
||||
|
||||
@Audited
|
||||
@Column
|
||||
@SuppressWarnings("NullAway.Init")
|
||||
private String name;
|
||||
|
||||
public Long getId() {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.hibernate.autoconfigure.test.country;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+8
-4
@@ -16,6 +16,10 @@
|
||||
|
||||
package org.springframework.boot.jackson.autoconfigure.jsontest.app;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Example object to read/write as JSON.
|
||||
*
|
||||
@@ -23,9 +27,9 @@ package org.springframework.boot.jackson.autoconfigure.jsontest.app;
|
||||
*/
|
||||
public class ExampleBasicObject {
|
||||
|
||||
private String value;
|
||||
private @Nullable String value;
|
||||
|
||||
public String getValue() {
|
||||
public @Nullable String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@@ -36,14 +40,14 @@ public class ExampleBasicObject {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj != null && obj.getClass() == getClass()) {
|
||||
return this.value.equals(((ExampleBasicObject) obj).value);
|
||||
return Objects.equals(this.value, ((ExampleBasicObject) obj).value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.value.hashCode();
|
||||
return Objects.hashCode(this.value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -19,6 +19,8 @@ package org.springframework.boot.jackson.autoconfigure.jsontest.app;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Example object to read/write as JSON through {@link ExampleJacksonComponent}.
|
||||
*
|
||||
@@ -27,6 +29,6 @@ import java.util.UUID;
|
||||
* @param date a date
|
||||
* @param uuid a uuid
|
||||
*/
|
||||
public record ExampleCustomObject(String value, Date date, UUID uuid) {
|
||||
public record ExampleCustomObject(@Nullable String value, @Nullable Date date, @Nullable UUID uuid) {
|
||||
|
||||
}
|
||||
|
||||
+9
-2
@@ -19,6 +19,7 @@ package org.springframework.boot.jackson.autoconfigure.jsontest.app;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import tools.jackson.core.JsonGenerator;
|
||||
import tools.jackson.core.JsonParser;
|
||||
import tools.jackson.databind.DeserializationContext;
|
||||
@@ -44,8 +45,14 @@ public class ExampleJacksonComponent {
|
||||
@Override
|
||||
protected void serializeObject(ExampleCustomObject value, JsonGenerator jgen, SerializationContext context) {
|
||||
jgen.writeStringProperty("value", value.value());
|
||||
jgen.writeNumberProperty("date", value.date().getTime());
|
||||
jgen.writeStringProperty("uuid", value.uuid().toString());
|
||||
@Nullable Date date = value.date();
|
||||
if (date != null) {
|
||||
jgen.writeNumberProperty("date", date.getTime());
|
||||
}
|
||||
@Nullable UUID uuid = value.uuid();
|
||||
if (uuid != null) {
|
||||
jgen.writeStringProperty("uuid", uuid.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@
|
||||
package org.springframework.boot.jackson.autoconfigure.jsontest.app;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@@ -28,11 +29,11 @@ import org.springframework.util.ObjectUtils;
|
||||
public class ExampleJsonObjectWithView {
|
||||
|
||||
@JsonView(TestView.class)
|
||||
private String value;
|
||||
private @Nullable String value;
|
||||
|
||||
private int id;
|
||||
|
||||
public String getValue() {
|
||||
public @Nullable String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.autoconfigure.jsontest.app;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.autoconfigure.jsontest;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.scan.a;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.scan.b;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.scan.c;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.scan.d;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+2
-1
@@ -17,6 +17,7 @@
|
||||
package org.springframework.boot.jackson.scan.e;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.jackson.JacksonMixin;
|
||||
import org.springframework.boot.jackson.types.Name;
|
||||
@@ -26,7 +27,7 @@ import org.springframework.boot.jackson.types.NameAndAge;
|
||||
class PrivateMixInClass {
|
||||
|
||||
@JsonProperty("username")
|
||||
String getName() {
|
||||
@Nullable String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.scan.e;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.scan.f;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
-3
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.jackson.types;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Sample object used for tests.
|
||||
*
|
||||
@@ -23,14 +25,14 @@ package org.springframework.boot.jackson.types;
|
||||
*/
|
||||
public class NameAndCareer extends Name {
|
||||
|
||||
private final String career;
|
||||
private final @Nullable String career;
|
||||
|
||||
public NameAndCareer(String name, String career) {
|
||||
public NameAndCareer(@Nullable String name, @Nullable String career) {
|
||||
super(name);
|
||||
this.career = career;
|
||||
}
|
||||
|
||||
public String getCareer() {
|
||||
public @Nullable String getCareer() {
|
||||
return this.career;
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson.types;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson2.scan.a;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson2.scan.b;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson2.scan.c;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson2.scan.d;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+2
-1
@@ -17,6 +17,7 @@
|
||||
package org.springframework.boot.jackson2.scan.e;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.jackson2.JsonMixin;
|
||||
import org.springframework.boot.jackson2.types.Name;
|
||||
@@ -28,7 +29,7 @@ import org.springframework.boot.jackson2.types.NameAndAge;
|
||||
class PrivateMixInClass {
|
||||
|
||||
@JsonProperty("username")
|
||||
String getName() {
|
||||
@Nullable String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson2.scan.e;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson2.scan.f;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+5
-3
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.jackson2.types;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Sample object used for tests.
|
||||
*
|
||||
@@ -25,13 +27,13 @@ package org.springframework.boot.jackson2.types;
|
||||
@Deprecated(since = "4.0.0", forRemoval = true)
|
||||
public class Name {
|
||||
|
||||
protected final String name;
|
||||
protected final @Nullable String name;
|
||||
|
||||
public Name(String name) {
|
||||
public Name(@Nullable String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
public @Nullable String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.jackson2.types;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
@@ -31,7 +33,7 @@ public final class NameAndAge extends Name {
|
||||
|
||||
private final int age;
|
||||
|
||||
public NameAndAge(String name, int age) {
|
||||
public NameAndAge(@Nullable String name, int age) {
|
||||
super(name);
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
+5
-3
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.jackson2.types;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Sample object used for tests.
|
||||
*
|
||||
@@ -26,14 +28,14 @@ package org.springframework.boot.jackson2.types;
|
||||
@SuppressWarnings("removal")
|
||||
public class NameAndCareer extends Name {
|
||||
|
||||
private final String career;
|
||||
private final @Nullable String career;
|
||||
|
||||
public NameAndCareer(String name, String career) {
|
||||
public NameAndCareer(@Nullable String name, @Nullable String career) {
|
||||
super(name);
|
||||
this.career = career;
|
||||
}
|
||||
|
||||
public String getCareer() {
|
||||
public @Nullable String getCareer() {
|
||||
return this.career;
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jackson2.types;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+8
-4
@@ -16,6 +16,10 @@
|
||||
|
||||
package org.springframework.boot.jsonb.autoconfigure.jsontest.app;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Example object to read/write as JSON.
|
||||
*
|
||||
@@ -23,9 +27,9 @@ package org.springframework.boot.jsonb.autoconfigure.jsontest.app;
|
||||
*/
|
||||
public class ExampleBasicObject {
|
||||
|
||||
private String value;
|
||||
private @Nullable String value;
|
||||
|
||||
public String getValue() {
|
||||
public @Nullable String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@@ -36,14 +40,14 @@ public class ExampleBasicObject {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj != null && obj.getClass() == getClass()) {
|
||||
return this.value.equals(((ExampleBasicObject) obj).value);
|
||||
return Objects.equals(this.value, ((ExampleBasicObject) obj).value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.value.hashCode();
|
||||
return Objects.hashCode(this.value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jsonb.autoconfigure.jsontest.app;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package org.springframework.boot.jsonb.autoconfigure.jsontest;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user