Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
-Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
-Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<bintray.package>commons</bintray.package>
<evictor.version>1.0.0</evictor.version>
<bouncycastle-bcprov-jdk18on.version>1.81</bouncycastle-bcprov-jdk18on.version>
<jspecify.enabled>true</jspecify.enabled>
</properties>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import java.net.URI;
import java.util.Map;

import org.jspecify.annotations.Nullable;

/**
* Represents an instance of a service in a discovery system.
*
Expand All @@ -30,7 +32,7 @@ public interface ServiceInstance {
/**
* @return The unique instance ID as registered.
*/
default String getInstanceId() {
default @Nullable String getInstanceId() {
return null;
}

Expand Down Expand Up @@ -67,7 +69,7 @@ default String getInstanceId() {
/**
* @return The scheme of the service instance.
*/
default String getScheme() {
default @Nullable String getScheme() {
return null;
}

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

package org.springframework.cloud.client.discovery;

import org.jspecify.annotations.Nullable;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
Expand Down Expand Up @@ -71,7 +73,7 @@ public static boolean isSame(BeanFactory beanFactory) {
return get(beanFactory) == ManagementServerPort.SAME;
}

public static Integer getPort(BeanFactory beanFactory) {
public static @Nullable Integer getPort(BeanFactory beanFactory) {
if (!hasActuator) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013-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.
*/

/**
* Spring Cloud service discovery abstractions.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.cloud.client.discovery;
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.cloud.client.loadbalancer;

import org.jspecify.annotations.Nullable;

import org.springframework.retry.RetryListener;
import org.springframework.retry.backoff.BackOffPolicy;
import org.springframework.retry.backoff.NoBackOffPolicy;
Expand All @@ -33,7 +35,8 @@ public interface LoadBalancedRetryFactory {
* @param serviceInstanceChooser Used to get the next server from a load balancer.
* @return A retry policy for the service.
*/
default LoadBalancedRetryPolicy createRetryPolicy(String service, ServiceInstanceChooser serviceInstanceChooser) {
default @Nullable LoadBalancedRetryPolicy createRetryPolicy(String service,
ServiceInstanceChooser serviceInstanceChooser) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013-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.
*/

/**
* Spring Cloud load balancer abstractions.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.cloud.client.loadbalancer;
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.Map;

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

import org.springframework.cloud.client.loadbalancer.DefaultRequest;
Expand Down Expand Up @@ -54,7 +55,7 @@ default Publisher<Response<T>> choose() { // conflicting name

interface Factory<T> {

default LoadBalancerProperties getProperties(String serviceId) {
default @Nullable LoadBalancerProperties getProperties(String serviceId) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013-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.
*/

/**
* Spring Cloud client abstractions.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.cloud.client;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013-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.
*/

/**
* Spring Cloud service registry abstractions.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.cloud.client.serviceregistry;
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
import java.util.HashMap;
import java.util.Map;

import org.jspecify.annotations.Nullable;

import org.springframework.boot.context.properties.source.ConfigurationPropertyName;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils;

/**
Expand All @@ -34,7 +35,7 @@ public class CommonsConfigAutoConfiguration {

@Bean
public DefaultsBindHandlerAdvisor defaultsBindHandlerAdvisor(
@Nullable DefaultsBindHandlerAdvisor.MappingsProvider[] providers) {
DefaultsBindHandlerAdvisor.@Nullable MappingsProvider @Nullable [] providers) {
Map<ConfigurationPropertyName, ConfigurationPropertyName> additionalMappings = new HashMap<>();
if (!ObjectUtils.isEmpty(providers)) {
for (DefaultsBindHandlerAdvisor.MappingsProvider mappingsProvider : providers) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013-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.
*/

/**
* Spring Cloud commons utilities and abstractions.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.cloud.commons;
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

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

/**
* @author Spencer Gibb
Expand Down Expand Up @@ -71,7 +72,7 @@ public HostInfo findFirstNonLoopbackHostInfo() {
return hostInfo;
}

public InetAddress findFirstNonLoopbackAddress() {
public @Nullable InetAddress findFirstNonLoopbackAddress() {
InetAddress result = null;
try {
int lowest = Integer.MAX_VALUE;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013-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.
*/

/**
* Spring Cloud auto-configuration classes.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.cloud.autoconfigure;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013-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.
*/

/**
* Spring Cloud bootstrap abstractions.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.cloud.bootstrap;
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.cloud.bootstrap.support;

import org.jspecify.annotations.Nullable;

import org.springframework.boot.origin.Origin;
import org.springframework.boot.origin.OriginLookup;
import org.springframework.core.env.CompositePropertySource;
Expand All @@ -33,7 +35,7 @@ public OriginTrackedCompositePropertySource(String name) {

@Override
@SuppressWarnings("unchecked")
public Origin getOrigin(String name) {
public @Nullable Origin getOrigin(String name) {
for (PropertySource<?> propertySource : getPropertySources()) {
if (propertySource instanceof OriginLookup lookup) {
Origin origin = lookup.getOrigin(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
import java.util.function.Supplier;
import java.util.stream.Stream;

import org.jspecify.annotations.Nullable;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.lang.Nullable;

/**
* Special ObjectProvider that allows the actual ObjectProvider to be resolved later
Expand Down Expand Up @@ -54,8 +55,7 @@ public T getObject(Object... args) throws BeansException {
}

@Override
@Nullable
public T getIfAvailable() throws BeansException {
public @Nullable T getIfAvailable() throws BeansException {
return delegate().getIfAvailable();
}

Expand All @@ -70,8 +70,7 @@ public void ifAvailable(Consumer<T> dependencyConsumer) throws BeansException {
}

@Override
@Nullable
public T getIfUnique() throws BeansException {
public @Nullable T getIfUnique() throws BeansException {
return delegate().getIfUnique();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013-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.
*/

/**
* Spring Cloud context abstractions.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.cloud.context;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
//

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.SpringApplication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.jspecify.annotations.Nullable;

import org.springframework.core.env.PropertySource;
import org.springframework.util.StringUtils;

Expand All @@ -44,7 +46,7 @@ public CachedRandomPropertySource(PropertySource randomValuePropertySource) {
}

@Override
public Object getProperty(String name) {
public @Nullable Object getProperty(String name) {
if (!name.startsWith(PREFIX) || name.length() == PREFIX.length()) {
return null;
}
Expand Down
Loading