Skip to content

Commit

Permalink
Remove unneeded @NonNull annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Dec 19, 2024
1 parent bc5d771 commit 0e85d95
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import java.beans.SimpleBeanInfo;
import java.util.Collection;

import org.jspecify.annotations.NonNull;

import org.springframework.core.Ordered;

/**
Expand All @@ -48,7 +46,7 @@
class SimpleBeanInfoFactory implements BeanInfoFactory, Ordered {

@Override
public @NonNull BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException {
public BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException {
Collection<? extends PropertyDescriptor> pds =
PropertyDescriptorUtils.determineBasicProperties(beanClass);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import java.beans.IntrospectionException;
import java.beans.Introspector;

import org.jspecify.annotations.NonNull;

import org.springframework.core.Ordered;
import org.springframework.core.SpringProperties;

Expand Down Expand Up @@ -67,7 +65,7 @@ public class StandardBeanInfoFactory implements BeanInfoFactory, Ordered {


@Override
public @NonNull BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException {
public BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException {
BeanInfo beanInfo = (shouldIntrospectorIgnoreBeaninfoClasses ?
Introspector.getBeanInfo(beanClass, Introspector.IGNORE_ALL_BEANINFO) :
Introspector.getBeanInfo(beanClass));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package org.springframework.beans.factory.support;

import org.jspecify.annotations.NonNull;

import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.config.BeanDefinition;

Expand Down Expand Up @@ -76,15 +74,15 @@ public BeanDefinitionOverrideException(
* Return the description of the resource that the bean definition came from.
*/
@Override
public @NonNull String getResourceDescription() {
public String getResourceDescription() {
return String.valueOf(super.getResourceDescription());
}

/**
* Return the name of the bean.
*/
@Override
public @NonNull String getBeanName() {
public String getBeanName() {
return String.valueOf(super.getBeanName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.NonNull;

import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
Expand Down Expand Up @@ -448,7 +447,7 @@ public AnnotationMetadata getMetadata() {
}

@Override
public @NonNull MethodMetadata getFactoryMethodMetadata() {
public MethodMetadata getFactoryMethodMetadata() {
return this.factoryMethodMetadata;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package org.springframework.scheduling.annotation;

import org.jspecify.annotations.NonNull;

import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.AdviceModeImportSelector;

Expand All @@ -44,7 +42,7 @@ public class AsyncConfigurationSelector extends AdviceModeImportSelector<EnableA
* respectively.
*/
@Override
public @NonNull String[] selectImports(AdviceMode adviceMode) {
public String[] selectImports(AdviceMode adviceMode) {
return switch (adviceMode) {
case PROXY -> new String[] {ProxyAsyncConfiguration.class.getName()};
case ASPECTJ -> new String[] {ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.io.Serializable;
import java.util.Map;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

import org.springframework.util.Assert;
Expand Down Expand Up @@ -62,7 +61,7 @@ public MapBindingResult(Map<?, ?> target, String objectName) {
}

@Override
public final @NonNull Object getTarget() {
public final Object getTarget() {
return this.target;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Arrays;
import java.util.List;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

import org.springframework.core.BridgeMethodResolver;
Expand Down Expand Up @@ -264,7 +263,7 @@ protected AnnotatedMethodParameter(AnnotatedMethodParameter original) {
}

@Override
public @NonNull Method getMethod() {
public Method getMethod() {
return AnnotatedMethod.this.getBridgedMethod();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.ArrayList;
import java.util.List;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

import org.springframework.beans.BeanWrapper;
Expand Down Expand Up @@ -90,7 +89,7 @@ public int getSqlType(String paramName) {
}

@Override
public @NonNull String[] getParameterNames() {
public String[] getParameterNames() {
return getReadablePropertyNames();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.LinkedHashMap;
import java.util.Map;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

import org.springframework.jdbc.core.SqlParameterValue;
Expand Down Expand Up @@ -174,7 +173,7 @@ public boolean hasValue(String paramName) {
}

@Override
public @NonNull String[] getParameterNames() {
public String[] getParameterNames() {
return StringUtils.toStringArray(this.values.keySet());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.function.Consumer;

import io.r2dbc.spi.Statement;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

import org.springframework.util.Assert;
Expand Down Expand Up @@ -206,7 +205,7 @@ public boolean hasValue() {
}

@Override
public @NonNull Object getValue() {
public Object getValue() {
return this.value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.InputStream;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

import org.springframework.util.Assert;
Expand Down Expand Up @@ -109,7 +108,7 @@ public String getName() {
}

@Override
public @NonNull String getOriginalFilename() {
public String getOriginalFilename() {
return this.originalFilename;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Map;
import java.util.function.Consumer;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
import org.reactivestreams.Publisher;

Expand Down Expand Up @@ -379,7 +378,7 @@ static final class PublisherEntity<T, P extends Publisher<T>> extends HttpEntity
* Return the element type for the {@code Publisher} body.
*/
@Override
public @NonNull ResolvableType getResolvableType() {
public ResolvableType getResolvableType() {
return this.resolvableType;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
import org.reactivestreams.Publisher;
import reactor.core.Exceptions;
Expand Down Expand Up @@ -172,7 +171,7 @@ public Mono<Object> decodeToMono(Publisher<DataBuffer> input, ResolvableType ele
}

@Override
public @NonNull Object decode(DataBuffer dataBuffer, ResolvableType targetType,
public Object decode(DataBuffer dataBuffer, ResolvableType targetType,
@Nullable MimeType mimeType, @Nullable Map<String, Object> hints) throws DecodingException {

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
import reactor.core.publisher.Flux;

Expand Down Expand Up @@ -214,12 +213,12 @@ protected MultiValueMap<String, HttpCookie> initCookies() {
}

@Override
public @NonNull InetSocketAddress getLocalAddress() {
public InetSocketAddress getLocalAddress() {
return new InetSocketAddress(this.request.getLocalAddr(), this.request.getLocalPort());
}

@Override
public @NonNull InetSocketAddress getRemoteAddress() {
public InetSocketAddress getRemoteAddress() {
return new InetSocketAddress(this.request.getRemoteHost(), this.request.getRemotePort());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.function.BiFunction;
import java.util.function.UnaryOperator;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

import org.springframework.util.Assert;
Expand Down Expand Up @@ -196,7 +195,7 @@ else if (this.port.contains("{")) {
}

@Override
public @NonNull String getPath() {
public String getPath() {
return this.path.getPath();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.InputStream;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

import org.springframework.util.Assert;
Expand Down Expand Up @@ -109,7 +108,7 @@ public String getName() {
}

@Override
public @NonNull String getOriginalFilename() {
public String getOriginalFilename() {
return this.originalFilename;
}

Expand Down

0 comments on commit 0e85d95

Please sign in to comment.