-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to JSpecify annotations for nullability constraints. #625
Conversation
pom.xml
Outdated
@@ -45,6 +45,11 @@ | |||
<version>${querydsl}</version> | |||
<optional>true</optional> | |||
</dependency> | |||
<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't required, JSpecify is a transitive dependency of Spring Framework.
@@ -195,6 +195,7 @@ public <T> T update(Object id, T objectToUpdate) { | |||
Assert.notNull(objectToUpdate, "Object to be updated must not be null"); | |||
|
|||
String keyspace = resolveKeySpace(objectToUpdate.getClass()); | |||
Assert.notNull(keyspace, "Keyspace must not be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch - added that one before the null check in resolveKeySpace
- same goes for others
|
||
Assert.notNull(id, "Id for object to be deleted must not be null"); | ||
Assert.notNull(type, "Type to delete must not be null"); | ||
|
||
String keyspace = resolveKeySpace(type); | ||
Assert.notNull(keyspace, "Keyspace must not be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be required.
@@ -233,6 +235,7 @@ public <T> Optional<T> findById(Object id, Class<T> type) { | |||
Assert.notNull(type, "Type to fetch must not be null"); | |||
|
|||
String keyspace = resolveKeySpace(type); | |||
Assert.notNull(keyspace, "Keyspace must not be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be required.
@@ -78,12 +79,13 @@ private List<?> sortAndFilterMatchingRange(Iterable<?> source, @Nullable Predica | |||
return filterMatchingRange(tmp, criteria, offset, rows); | |||
} | |||
|
|||
private static <S> List<S> filterMatchingRange(List<S> source, @Nullable Predicate criteria, long offset, int rows) { | |||
@Contract("!null, _, _, _ -> !null") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, the return is never null
and source
cannot be null
. You sure about this annotation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never null regardless of input - I don't mind dropping it.
@@ -145,7 +145,7 @@ public void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConf | |||
|
|||
AbstractBeanDefinition beanDefinition = getDefaultKeyValueTemplateBeanDefinition(configurationSource); | |||
|
|||
if (beanDefinition != null) { | |||
if (beanDefinition != null && configurationSource.getSource() != null) { | |||
registerIfNotAlreadyRegistered(() -> beanDefinition, registry, keyValueTemplateName.get(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a missing @Nullable
annotation for source
in Commons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe... care to check in commons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.