Skip to content

Commit b8b3635

Browse files
committed
Migrate to JSpecify annotations for nullability constraints.
Closes #528
1 parent 1cdf99a commit b8b3635

37 files changed

+99
-53
lines changed

.mvn/jvm.config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
2+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
3+
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
4+
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
5+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
6+
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
7+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
8+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
9+
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
10+
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@
9595
<version>${cdi}</version>
9696
<optional>true</optional>
9797
</dependency>
98+
<dependency>
99+
<groupId>org.jspecify</groupId>
100+
<artifactId>jspecify</artifactId>
101+
<version>1.0.0</version>
102+
</dependency>
98103

99104
<dependency>
100105
<groupId>jakarta.annotation</groupId>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/**
22
* XML configuration support for Spring Data LDAP repositories.
33
*/
4-
@NonNullApi
4+
@org.jspecify.annotations.NullMarked
55
package org.springframework.data.ldap.config;
6-
7-
import org.springframework.lang.NonNullApi;

src/main/java/org/springframework/data/ldap/core/mapping/BasicLdapPersistentEntity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ public class BasicLdapPersistentEntity<T> extends BasicPersistentEntity<T, LdapP
3535
public BasicLdapPersistentEntity(TypeInformation<T> information) {
3636
super(information);
3737
}
38+
3839
}

src/main/java/org/springframework/data/ldap/core/mapping/LdapMappingContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ protected LdapPersistentProperty createPersistentProperty(Property property, Bas
4545
SimpleTypeHolder simpleTypeHolder) {
4646
return new LdapPersistentProperty(property, owner, simpleTypeHolder);
4747
}
48+
4849
}

src/main/java/org/springframework/data/ldap/core/mapping/LdapPersistentProperty.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ public LdapPersistentProperty(Property property, PersistentEntity<?, LdapPersist
4848

4949
@Override
5050
protected Association<LdapPersistentProperty> createAssociation() {
51-
return null;
51+
throw new UnsupportedOperationException("LDAP does not support associations");
5252
}
5353

5454
@Override
5555
public boolean isIdProperty() {
5656
return isId.get();
5757
}
58+
5859
}

src/main/java/org/springframework/data/ldap/core/mapping/LdapSimpleTypes.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ public abstract class LdapSimpleTypes {
4444
public static final SimpleTypeHolder HOLDER = new SimpleTypeHolder(VAULT_SIMPLE_TYPES, true);
4545

4646
private LdapSimpleTypes() {}
47+
4748
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* Infrastructure for the LDAP object mapping subsystem.
33
*/
4-
@org.springframework.lang.NonNullApi
5-
@org.springframework.lang.NonNullFields
4+
@org.jspecify.annotations.NullMarked
65
package org.springframework.data.ldap.core.mapping;

src/main/java/org/springframework/data/ldap/repository/LdapEncoder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class NameEncoder implements LdapEncoder {
4949
public String encode(String value) {
5050
return org.springframework.ldap.support.LdapEncoder.nameEncode(value);
5151
}
52+
5253
}
5354

5455
/**
@@ -79,6 +80,7 @@ public String encode(String value) {
7980

8081
return buff.toString();
8182
}
83+
8284
}
8385

8486
}

src/main/java/org/springframework/data/ldap/repository/LdapRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ public interface LdapRepository<T> extends ListCrudRepository<T, Name> {
4848
* @return the entries matching the query.
4949
*/
5050
List<T> findAll(LdapQuery ldapQuery);
51+
5152
}

0 commit comments

Comments
 (0)