Skip to content

Commit d2b8c81

Browse files
committed
Normalize formatting and whitespace
Apply code style and formatting fixes across modules: adjust Javadoc alignment and comment blocks, normalize parameter and cast spacing, add missing trailing newlines, insert/adjust blank lines in imports and inner classes, and minor constructor/indentation tweaks. Changes touch commons and openfeign packages and related tests to improve consistency and reduce trivial diffs.
1 parent 6530df8 commit d2b8c81

13 files changed

Lines changed: 40 additions & 31 deletions

File tree

microsphere-spring-cloud-commons/src/main/java/io/microsphere/spring/cloud/client/service/registry/SimpleAutoServiceRegistration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class SimpleAutoServiceRegistration extends AbstractAutoServiceRegistrati
5353
* @param registration the {@link Registration} to manage
5454
*/
5555
public SimpleAutoServiceRegistration(ServiceRegistry<Registration> serviceRegistry,
56-
AutoServiceRegistrationProperties properties, Registration registration) {
56+
AutoServiceRegistrationProperties properties, Registration registration) {
5757
super(serviceRegistry, properties);
5858
this.properties = properties;
5959
this.registration = registration;
@@ -124,4 +124,4 @@ protected Registration getRegistration() {
124124
protected Registration getManagementRegistration() {
125125
return registration;
126126
}
127-
}
127+
}

microsphere-spring-cloud-commons/src/main/java/io/microsphere/spring/cloud/client/service/registry/autoconfigure/SimpleAutoServiceRegistrationAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ public class SimpleAutoServiceRegistrationAutoConfiguration {
9191
* String serviceId = registration.getServiceId();
9292
* }</pre>
9393
*
94-
* @param applicationName the Spring application name resolved from {@code spring.application.name}
94+
* @param applicationName the Spring application name resolved from {@code spring.application.name}
9595
* @param serverProperties the {@link ServerProperties} providing the server port
96-
* @param inetUtils the {@link InetUtils} for resolving the host address
96+
* @param inetUtils the {@link InetUtils} for resolving the host address
9797
* @return a new {@link DefaultRegistration} instance
9898
*/
9999
@Bean
@@ -132,4 +132,4 @@ public Registration registration(
132132
public ServiceRegistry<Registration> serviceRegistry() {
133133
return new InMemoryServiceRegistry();
134134
}
135-
}
135+
}

microsphere-spring-cloud-commons/src/main/java/io/microsphere/spring/cloud/client/service/util/ServiceInstanceUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ public class ServiceInstanceUtils extends BaseUtils {
7777
* ServiceInstanceUtils.attachMetadata("/context", serviceInstance, mappings);
7878
* }</pre>
7979
*
80-
* @param contextPath the web application context path
81-
* @param serviceInstance the {@link ServiceInstance} to attach metadata to
82-
* @param webEndpointMappings the collection of {@link WebEndpointMapping}s to attach
80+
* @param contextPath the web application context path
81+
* @param serviceInstance the {@link ServiceInstance} to attach metadata to
82+
* @param webEndpointMappings the collection of {@link WebEndpointMapping}s to attach
8383
*/
8484
public static void attachMetadata(String contextPath, ServiceInstance serviceInstance, Collection<WebEndpointMapping> webEndpointMappings) {
8585
Map<String, String> metadata = serviceInstance.getMetadata();
@@ -251,4 +251,4 @@ static String[] getArray(JSONObject jsonObject, String name) {
251251

252252
private ServiceInstanceUtils() {
253253
}
254-
}
254+
}

microsphere-spring-cloud-openfeign/src/main/java/io/microsphere/spring/cloud/openfeign/autorefresh/EnableFeignAutoRefresh.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
})
3030
public @interface EnableFeignAutoRefresh {
3131

32-
class Marker {}
33-
}
32+
class Marker {
33+
}
34+
}

microsphere-spring-cloud-openfeign/src/main/java/io/microsphere/spring/cloud/openfeign/components/DecoratedDecoder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ protected Class<? extends Decoder> componentType() {
6666
* @param response the Feign {@link Response} to decode
6767
* @param type the target type to decode into
6868
* @return the decoded object
69-
* @throws IOException if an I/O error occurs
70-
* @throws DecodeException if decoding fails
71-
* @throws FeignException if a Feign-specific error occurs
69+
* @throws IOException if an I/O error occurs
70+
* @throws DecodeException if decoding fails
71+
* @throws FeignException if a Feign-specific error occurs
7272
*/
7373
@Override
7474
public Object decode(Response response, Type type) throws IOException, DecodeException, FeignException {
7575
return delegate().decode(response, type);
7676
}
77-
}
77+
}

microsphere-spring-cloud-openfeign/src/main/java/io/microsphere/spring/cloud/openfeign/components/DecoratedFeignComponent.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,19 +214,25 @@ protected T loadInstance() {
214214
return loadInstanceFromContextFactory(contextId, componentType);
215215
}
216216

217-
/** {@inheritDoc} */
217+
/**
218+
* {@inheritDoc}
219+
*/
218220
@Override
219221
public int hashCode() {
220222
return delegate().hashCode();
221223
}
222224

223-
/** {@inheritDoc} */
225+
/**
226+
* {@inheritDoc}
227+
*/
224228
@Override
225229
public boolean equals(Object obj) {
226230
return delegate().equals(obj);
227231
}
228232

229-
/** {@inheritDoc} */
233+
/**
234+
* {@inheritDoc}
235+
*/
230236
@Override
231237
public String toString() {
232238
return delegate().toString();
@@ -262,4 +268,4 @@ public static <W extends DecoratedFeignComponent<T>, T> W instantiate(Class<W> d
262268
Constructor<W> constructor = findConstructor(decoratedClass, String.class, NamedContextFactory.class, FeignClientProperties.class, componentClass);
263269
return instantiateClass(constructor, contextId, contextFactory, clientProperties, delegate);
264270
}
265-
}
271+
}

microsphere-spring-cloud-openfeign/src/test/java/io/microsphere/spring/cloud/openfeign/decoder/DecoderComponentAssert.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected Decoder loadCurrentComponent(Object configuration, ResponseHandler res
1818
Class<ResponseHandler> responseHandlerClass = ResponseHandler.class;
1919
Field decoderField = responseHandlerClass.getDeclaredField("decoder");
2020
decoderField.setAccessible(true);
21-
DecoratedDecoder decoder = (DecoratedDecoder)decoderField.get(responseHandler);
21+
DecoratedDecoder decoder = (DecoratedDecoder) decoderField.get(responseHandler);
2222
return decoder.delegate();
2323
}
24-
}
24+
}

microsphere-spring-cloud-openfeign/src/test/java/io/microsphere/spring/cloud/openfeign/encoder/EncoderComponentAssert.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected Encoder loadCurrentComponent(Object configuration, ResponseHandler res
2828
Class<?> buildTemplateFromArgsType = buildTemplateFromArgsValue.getClass();
2929
Field encoderField = buildTemplateFromArgsType.getDeclaredField("encoder");
3030
encoderField.setAccessible(true);
31-
DecoratedEncoder encoder = (DecoratedEncoder)encoderField.get(buildTemplateFromArgsValue);
31+
DecoratedEncoder encoder = (DecoratedEncoder) encoderField.get(buildTemplateFromArgsValue);
3232
return encoder.delegate();
3333
}
34-
}
34+
}

microsphere-spring-cloud-openfeign/src/test/java/io/microsphere/spring/cloud/openfeign/errordecoder/AErrorDecoder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import feign.Response;
44
import feign.codec.ErrorDecoder;
55
import io.microsphere.logging.Logger;
6+
67
import static io.microsphere.logging.LoggerFactory.getLogger;
78

89
/**
@@ -17,4 +18,4 @@ public class AErrorDecoder implements ErrorDecoder {
1718
public Exception decode(String methodKey, Response response) {
1819
return new IllegalArgumentException("");
1920
}
20-
}
21+
}

microsphere-spring-cloud-openfeign/src/test/java/io/microsphere/spring/cloud/openfeign/errordecoder/ErrorDecoderComponentAssert.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected ErrorDecoder loadCurrentComponent(Object configuration, ResponseHandle
1818
Class<ResponseHandler> responseHandlerClass = ResponseHandler.class;
1919
Field errorDecoderField = responseHandlerClass.getDeclaredField("errorDecoder");
2020
errorDecoderField.setAccessible(true);
21-
DecoratedErrorDecoder errorDecoder = (DecoratedErrorDecoder)errorDecoderField.get(responseHandler);
21+
DecoratedErrorDecoder errorDecoder = (DecoratedErrorDecoder) errorDecoderField.get(responseHandler);
2222
return errorDecoder.delegate();
2323
}
24-
}
24+
}

0 commit comments

Comments
 (0)