Skip to content

Commit f272819

Browse files
committed
Replace NonNull with Nonnull & tidy imports
Use io.microsphere.annotation.Nonnull in GatewayUtils instead of org.springframework.lang.NonNull and update the corresponding method annotations. Reorder and clean up imports in GatewayAutoConfiguration and DisabledHeartbeatEventRouteRefreshListenerInterceptor. Remove several unused imports from test classes. These are non-functional cleanup changes to standardize annotations and reduce import noise.
1 parent 9622791 commit f272819

7 files changed

Lines changed: 5 additions & 9 deletions

File tree

microsphere-spring-cloud-gateway-server-webflux/src/main/java/io/microsphere/spring/cloud/gateway/server/webflux/autoconfigure/GatewayAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
*/
1717
package io.microsphere.spring.cloud.gateway.server.webflux.autoconfigure;
1818

19-
import io.microsphere.spring.cloud.gateway.server.webflux.annotation.ConditionalOnGatewayEnabled;
2019
import io.microsphere.spring.cloud.gateway.commons.annotation.ConditionalOnMicrosphereGatewayEnabled;
20+
import io.microsphere.spring.cloud.gateway.server.webflux.annotation.ConditionalOnGatewayEnabled;
2121
import io.microsphere.spring.cloud.gateway.server.webflux.event.DisabledHeartbeatEventRouteRefreshListenerInterceptor;
2222
import io.microsphere.spring.cloud.gateway.server.webflux.event.PropagatingRefreshRoutesEventApplicationListener;
2323
import io.microsphere.spring.cloud.gateway.server.webflux.filter.WebEndpointMappingGlobalFilter;

microsphere-spring-cloud-gateway-server-webflux/src/main/java/io/microsphere/spring/cloud/gateway/server/webflux/event/DisabledHeartbeatEventRouteRefreshListenerInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*/
1717
package io.microsphere.spring.cloud.gateway.server.webflux.event;
1818

19+
import io.microsphere.logging.Logger;
1920
import io.microsphere.spring.context.event.ApplicationListenerInterceptor;
2021
import io.microsphere.spring.context.event.ApplicationListenerInterceptorChain;
21-
import io.microsphere.logging.Logger;
2222
import org.springframework.cloud.client.discovery.event.HeartbeatEvent;
2323
import org.springframework.cloud.client.discovery.event.ParentHeartbeatEvent;
2424
import org.springframework.cloud.gateway.route.RouteRefreshListener;

microsphere-spring-cloud-gateway-server-webflux/src/main/java/io/microsphere/spring/cloud/gateway/server/webflux/util/GatewayUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
*/
1717
package io.microsphere.spring.cloud.gateway.server.webflux.util;
1818

19+
import io.microsphere.annotation.Nonnull;
1920
import io.microsphere.util.Utils;
2021
import org.springframework.cloud.gateway.config.GatewayProperties;
2122
import org.springframework.cloud.gateway.event.RefreshRoutesResultEvent;
2223
import org.springframework.cloud.gateway.route.RouteDefinition;
2324
import org.springframework.cloud.gateway.route.RouteLocator;
2425
import org.springframework.core.env.ConfigurableEnvironment;
2526
import org.springframework.core.env.Environment;
26-
import org.springframework.lang.NonNull;
2727

2828
import java.util.HashMap;
2929
import java.util.Map;
@@ -50,7 +50,7 @@ public abstract class GatewayUtils implements Utils {
5050
* @param environment {@link ConfigurableEnvironment}
5151
* @return non-null
5252
*/
53-
@NonNull
53+
@Nonnull
5454
public static Map<String, Object> getGatewayProperties(ConfigurableEnvironment environment) {
5555
return getSubProperties(environment, PREFIX);
5656
}
@@ -63,7 +63,7 @@ public static Map<String, Object> getGatewayProperties(ConfigurableEnvironment e
6363
* @param routeId the id of {@link RouteDefinition}
6464
* @return non-null
6565
*/
66-
@NonNull
66+
@Nonnull
6767
public static Map<String, Object> getRouteProperties(ConfigurableEnvironment environment, String routeId) {
6868
Map<String, Object> gatewayProperties = getGatewayProperties(environment);
6969
String prefix = null;

microsphere-spring-cloud-gateway-server-webflux/src/test/java/io/microsphere/spring/cloud/gateway/server/webflux/constants/GatewayPropertyConstantsTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package io.microsphere.spring.cloud.gateway.server.webflux.constants;
1919

2020

21-
import io.microsphere.spring.cloud.gateway.server.webflux.constants.GatewayPropertyConstants;
2221
import org.junit.jupiter.api.Test;
2322

2423
import static io.microsphere.constants.PropertyConstants.ENABLED_PROPERTY_NAME;

microsphere-spring-cloud-gateway-server-webflux/src/test/java/io/microsphere/spring/cloud/gateway/server/webflux/filter/WebEndpointMappingGlobalFilterStaticTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package io.microsphere.spring.cloud.gateway.server.webflux.filter;
1919

20-
import io.microsphere.spring.cloud.gateway.server.webflux.filter.WebEndpointMappingGlobalFilter;
2120
import org.junit.jupiter.api.Test;
2221
import org.springframework.cloud.client.DefaultServiceInstance;
2322
import org.springframework.cloud.client.ServiceInstance;

microsphere-spring-cloud-gateway-server-webflux/src/test/java/io/microsphere/spring/cloud/gateway/server/webflux/handler/CachingFilteringWebHandlerTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package io.microsphere.spring.cloud.gateway.server.webflux.handler;
1818

19-
import io.microsphere.spring.cloud.gateway.server.webflux.handler.CachingFilteringWebHandler;
2019
import org.junit.jupiter.api.BeforeEach;
2120
import org.junit.jupiter.api.Test;
2221
import org.springframework.cloud.gateway.event.RefreshRoutesResultEvent;

microsphere-spring-cloud-gateway-server-webflux/src/test/java/io/microsphere/spring/cloud/gateway/server/webflux/util/GatewayUtilsTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package io.microsphere.spring.cloud.gateway.server.webflux.util;
1919

2020

21-
import io.microsphere.spring.cloud.gateway.server.webflux.util.GatewayUtils;
2221
import org.junit.jupiter.api.BeforeEach;
2322
import org.junit.jupiter.api.Test;
2423
import org.springframework.boot.env.YamlPropertySourceLoader;

0 commit comments

Comments
 (0)