diff --git a/pom.xml b/pom.xml
index eaddc3b..3fd59de 100644
--- a/pom.xml
+++ b/pom.xml
@@ -219,7 +219,7 @@
io.spring.javaformat
spring-javaformat-maven-plugin
- 0.0.31
+ 0.0.39
org.apache.maven.plugins
diff --git a/src/main/java/org/springframework/classify/ClassifierAdapter.java b/src/main/java/org/springframework/classify/ClassifierAdapter.java
index 24720e3..6d437e4 100644
--- a/src/main/java/org/springframework/classify/ClassifierAdapter.java
+++ b/src/main/java/org/springframework/classify/ClassifierAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2023 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.
@@ -76,7 +76,7 @@ public class ClassifierAdapter implements Classifier {
public final void setDelegate(Object delegate) {
this.classifier = null;
this.invoker = MethodInvokerUtils
- .getMethodInvokerByAnnotation(org.springframework.classify.annotation.Classifier.class, delegate);
+ .getMethodInvokerByAnnotation(org.springframework.classify.annotation.Classifier.class, delegate);
if (this.invoker == null) {
this.invoker = MethodInvokerUtils.getMethodInvokerForSingleArgument(delegate);
}
diff --git a/src/main/java/org/springframework/retry/annotation/AnnotationAwareRetryOperationsInterceptor.java b/src/main/java/org/springframework/retry/annotation/AnnotationAwareRetryOperationsInterceptor.java
index 764f20b..10b5dcb 100644
--- a/src/main/java/org/springframework/retry/annotation/AnnotationAwareRetryOperationsInterceptor.java
+++ b/src/main/java/org/springframework/retry/annotation/AnnotationAwareRetryOperationsInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2022 the original author or authors.
+ * Copyright 2006-2023 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.
@@ -228,8 +228,11 @@ public class AnnotationAwareRetryOperationsInterceptor implements IntroductionIn
RetryTemplate template = createTemplate(retryable.listeners());
template.setRetryPolicy(getRetryPolicy(retryable, true));
template.setBackOffPolicy(getBackoffPolicy(retryable.backoff(), true));
- return RetryInterceptorBuilder.stateless().retryOperations(template).label(retryable.label())
- .recoverer(getRecoverer(target, method)).build();
+ return RetryInterceptorBuilder.stateless()
+ .retryOperations(template)
+ .label(retryable.label())
+ .recoverer(getRecoverer(target, method))
+ .build();
}
private MethodInterceptor getStatefulInterceptor(Object target, Method method, Retryable retryable) {
@@ -251,16 +254,24 @@ public class AnnotationAwareRetryOperationsInterceptor implements IntroductionIn
if (!StringUtils.hasText(label)) {
label = method.toGenericString();
}
- return RetryInterceptorBuilder.circuitBreaker().keyGenerator(new FixedKeyGenerator("circuit"))
- .retryOperations(template).recoverer(getRecoverer(target, method)).label(label).build();
+ return RetryInterceptorBuilder.circuitBreaker()
+ .keyGenerator(new FixedKeyGenerator("circuit"))
+ .retryOperations(template)
+ .recoverer(getRecoverer(target, method))
+ .label(label)
+ .build();
}
RetryPolicy policy = getRetryPolicy(retryable, false);
template.setRetryPolicy(policy);
template.setBackOffPolicy(getBackoffPolicy(retryable.backoff(), false));
String label = retryable.label();
- return RetryInterceptorBuilder.stateful().keyGenerator(this.methodArgumentsKeyGenerator)
- .newMethodArgumentsIdentifier(this.newMethodArgumentsIdentifier).retryOperations(template).label(label)
- .recoverer(getRecoverer(target, method)).build();
+ return RetryInterceptorBuilder.stateful()
+ .keyGenerator(this.methodArgumentsKeyGenerator)
+ .newMethodArgumentsIdentifier(this.newMethodArgumentsIdentifier)
+ .retryOperations(template)
+ .label(label)
+ .recoverer(getRecoverer(target, method))
+ .build();
}
private void openTimeout(CircuitBreakerRetryPolicy breaker, CircuitBreaker circuit) {
@@ -383,7 +394,8 @@ public class AnnotationAwareRetryOperationsInterceptor implements IntroductionIn
if (simple == null) {
if (hasExpression) {
simple = new ExpressionRetryPolicy(maxAttempts, policyMap, true, resolve(exceptionExpression),
- retryNotExcluded).withBeanFactory(this.beanFactory);
+ retryNotExcluded)
+ .withBeanFactory(this.beanFactory);
}
else {
simple = new SimpleRetryPolicy(maxAttempts, policyMap, true, retryNotExcluded);
diff --git a/src/main/java/org/springframework/retry/annotation/RetryConfiguration.java b/src/main/java/org/springframework/retry/annotation/RetryConfiguration.java
index 72d9aa5..d277436 100644
--- a/src/main/java/org/springframework/retry/annotation/RetryConfiguration.java
+++ b/src/main/java/org/springframework/retry/annotation/RetryConfiguration.java
@@ -99,7 +99,7 @@ public class RetryConfiguration extends AbstractPointcutAdvisor
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.enableRetry = AnnotationAttributes
- .fromMap(importMetadata.getAnnotationAttributes(EnableRetry.class.getName()));
+ .fromMap(importMetadata.getAnnotationAttributes(EnableRetry.class.getName()));
}
@Override
diff --git a/src/test/java/org/springframework/classify/BinaryExceptionClassifierBuilderTests.java b/src/test/java/org/springframework/classify/BinaryExceptionClassifierBuilderTests.java
index a263829..0c81e2b 100644
--- a/src/test/java/org/springframework/classify/BinaryExceptionClassifierBuilderTests.java
+++ b/src/test/java/org/springframework/classify/BinaryExceptionClassifierBuilderTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2022 the original author or authors.
+ * Copyright 2006-2023 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.
@@ -37,8 +37,10 @@ public class BinaryExceptionClassifierBuilderTests {
public void testWhiteList() {
RetryTemplate.builder().infiniteRetry().retryOn(IOException.class).uniformRandomBackoff(1000, 3000).build();
- BinaryExceptionClassifier classifier = BinaryExceptionClassifier.builder().retryOn(IOException.class)
- .retryOn(TimeoutException.class).build();
+ BinaryExceptionClassifier classifier = BinaryExceptionClassifier.builder()
+ .retryOn(IOException.class)
+ .retryOn(TimeoutException.class)
+ .build();
assertThat(classifier.classify(new IOException())).isTrue();
// should not retry due to traverseCauses=fasle
@@ -49,8 +51,11 @@ public class BinaryExceptionClassifierBuilderTests {
@Test
public void testWhiteListWithTraverseCauses() {
- BinaryExceptionClassifier classifier = BinaryExceptionClassifier.builder().retryOn(IOException.class)
- .retryOn(TimeoutException.class).traversingCauses().build();
+ BinaryExceptionClassifier classifier = BinaryExceptionClassifier.builder()
+ .retryOn(IOException.class)
+ .retryOn(TimeoutException.class)
+ .traversingCauses()
+ .build();
assertThat(classifier.classify(new IOException())).isTrue();
// should retry due to traverseCauses=true
@@ -63,8 +68,11 @@ public class BinaryExceptionClassifierBuilderTests {
@Test
public void testBlackList() {
- BinaryExceptionClassifier classifier = BinaryExceptionClassifier.builder().notRetryOn(Error.class)
- .notRetryOn(InterruptedException.class).traversingCauses().build();
+ BinaryExceptionClassifier classifier = BinaryExceptionClassifier.builder()
+ .notRetryOn(Error.class)
+ .notRetryOn(InterruptedException.class)
+ .traversingCauses()
+ .build();
// should not retry due to OutOfMemoryError is a subclass of Error
assertThat(classifier.classify(new OutOfMemoryError())).isFalse();
@@ -77,7 +85,8 @@ public class BinaryExceptionClassifierBuilderTests {
@Test
public void testFailOnNotationMix() {
assertThatIllegalArgumentException().isThrownBy(() -> BinaryExceptionClassifier.builder()
- .retryOn(IOException.class).notRetryOn(OutOfMemoryError.class));
+ .retryOn(IOException.class)
+ .notRetryOn(OutOfMemoryError.class));
}
}
diff --git a/src/test/java/org/springframework/classify/BinaryExceptionClassifierTests.java b/src/test/java/org/springframework/classify/BinaryExceptionClassifierTests.java
index 305aa37..205a7fb 100644
--- a/src/test/java/org/springframework/classify/BinaryExceptionClassifierTests.java
+++ b/src/test/java/org/springframework/classify/BinaryExceptionClassifierTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2022 the original author or authors.
+ * Copyright 2006-2023 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.
@@ -55,14 +55,14 @@ public class BinaryExceptionClassifierTests {
@Test
public void testClassifyExactMatch() {
Collection> set = Collections
- .>singleton(IllegalStateException.class);
+ .>singleton(IllegalStateException.class);
assertThat(new BinaryExceptionClassifier(set).classify(new IllegalStateException("Foo"))).isTrue();
}
@Test
public void testClassifyExactMatchInCause() {
Collection> set = Collections
- .>singleton(IllegalStateException.class);
+ .>singleton(IllegalStateException.class);
BinaryExceptionClassifier binaryExceptionClassifier = new BinaryExceptionClassifier(set);
binaryExceptionClassifier.setTraverseCauses(true);
assertThat(binaryExceptionClassifier.classify(new RuntimeException(new IllegalStateException("Foo")))).isTrue();
@@ -71,7 +71,7 @@ public class BinaryExceptionClassifierTests {
@Test
public void testClassifySubclassMatchInCause() {
Collection> set = Collections
- .>singleton(IllegalStateException.class);
+ .>singleton(IllegalStateException.class);
BinaryExceptionClassifier binaryExceptionClassifier = new BinaryExceptionClassifier(set);
binaryExceptionClassifier.setTraverseCauses(true);
assertThat(binaryExceptionClassifier.classify(new RuntimeException(new FooException("Foo")))).isTrue();
@@ -86,9 +86,9 @@ public class BinaryExceptionClassifierTests {
binaryExceptionClassifier.setTraverseCauses(true);
assertThat(
binaryExceptionClassifier.classify(new RuntimeException(new FooException("Foo", new BarException()))))
- .isTrue();
+ .isTrue();
assertThat(((Map, ?>) new DirectFieldAccessor(binaryExceptionClassifier).getPropertyValue("classified"))
- .containsKey(FooException.class)).isTrue();
+ .containsKey(FooException.class)).isTrue();
}
@Test
@@ -111,7 +111,7 @@ public class BinaryExceptionClassifierTests {
Collections.>singleton(IllegalStateException.class), false);
classifier.setTraverseCauses(true);
assertThat(classifier.classify(new RuntimeException(new RuntimeException(new IllegalStateException("Foo")))))
- .isFalse();
+ .isFalse();
}
@SuppressWarnings("serial")
diff --git a/src/test/java/org/springframework/classify/SubclassExceptionClassifierTests.java b/src/test/java/org/springframework/classify/SubclassExceptionClassifierTests.java
index c7cd12d..c77a39f 100644
--- a/src/test/java/org/springframework/classify/SubclassExceptionClassifierTests.java
+++ b/src/test/java/org/springframework/classify/SubclassExceptionClassifierTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2022 the original author or authors.
+ * Copyright 2006-2023 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.
@@ -61,8 +61,8 @@ public class SubclassExceptionClassifierTests {
@Test
public void testClassifySubclassMatch() {
- this.classifier.setTypeMap(
- Collections., String>singletonMap(RuntimeException.class, "foo"));
+ this.classifier
+ .setTypeMap(Collections., String>singletonMap(RuntimeException.class, "foo"));
assertThat(this.classifier.classify(new IllegalStateException("Foo"))).isEqualTo("foo");
}
diff --git a/src/test/java/org/springframework/retry/AnyThrowTests.java b/src/test/java/org/springframework/retry/AnyThrowTests.java
index c0f364d..d35a600 100644
--- a/src/test/java/org/springframework/retry/AnyThrowTests.java
+++ b/src/test/java/org/springframework/retry/AnyThrowTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2022 the original author or authors.
+ * Copyright 2006-2023 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.
@@ -30,13 +30,13 @@ public class AnyThrowTests {
@Test
public void testRuntimeException() {
assertThatExceptionOfType(RuntimeException.class)
- .isThrownBy(() -> AnyThrow.throwAny(new RuntimeException("planned")));
+ .isThrownBy(() -> AnyThrow.throwAny(new RuntimeException("planned")));
}
@Test
public void testUncheckedRuntimeException() {
assertThatExceptionOfType(RuntimeException.class)
- .isThrownBy(() -> AnyThrow.throwUnchecked(new RuntimeException("planned")));
+ .isThrownBy(() -> AnyThrow.throwUnchecked(new RuntimeException("planned")));
}
@Test
diff --git a/src/test/java/org/springframework/retry/annotation/CircuitBreakerTests.java b/src/test/java/org/springframework/retry/annotation/CircuitBreakerTests.java
index a6b2339..6117d34 100644
--- a/src/test/java/org/springframework/retry/annotation/CircuitBreakerTests.java
+++ b/src/test/java/org/springframework/retry/annotation/CircuitBreakerTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015-2022 the original author or authors.
+ * Copyright 2006-2023 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.
@@ -69,13 +69,13 @@ public class CircuitBreakerTests {
assertThat(delegates).hasSize(1);
Map, ?> methodMap = (Map, ?>) delegates.values().iterator().next();
MethodInterceptor interceptor = (MethodInterceptor) methodMap
- .get(Service.class.getDeclaredMethod("expressionService"));
+ .get(Service.class.getDeclaredMethod("expressionService"));
DirectFieldAccessor accessor = new DirectFieldAccessor(interceptor);
assertThat(accessor.getPropertyValue("retryOperations.retryPolicy.delegate.maxAttempts")).isEqualTo(8);
assertThat(accessor.getPropertyValue("retryOperations.retryPolicy.openTimeout")).isEqualTo(19000L);
assertThat(accessor.getPropertyValue("retryOperations.retryPolicy.resetTimeout")).isEqualTo(20000L);
assertThat(accessor.getPropertyValue("retryOperations.retryPolicy.delegate.expression.expression"))
- .isEqualTo("#root instanceof RuntimeExpression");
+ .isEqualTo("#root instanceof RuntimeExpression");
interceptor = (MethodInterceptor) methodMap.get(Service.class.getDeclaredMethod("expressionService2"));
accessor = new DirectFieldAccessor(interceptor);
@@ -98,7 +98,7 @@ public class CircuitBreakerTests {
assertThat(delegates).hasSize(1);
Map, ?> methodMap = (Map, ?>) delegates.values().iterator().next();
MethodInterceptor interceptor = (MethodInterceptor) methodMap
- .get(Service.class.getDeclaredMethod("expressionService3"));
+ .get(Service.class.getDeclaredMethod("expressionService3"));
Supplier> maxAttempts = TestUtils.getPropertyValue(interceptor,
"retryOperations.retryPolicy.delegate.maxAttemptsSupplier", Supplier.class);
assertThat(maxAttempts).isNotNull();
diff --git a/src/test/java/org/springframework/retry/annotation/EnableRetryTests.java b/src/test/java/org/springframework/retry/annotation/EnableRetryTests.java
index 50fd2ed..de1aac8 100644
--- a/src/test/java/org/springframework/retry/annotation/EnableRetryTests.java
+++ b/src/test/java/org/springframework/retry/annotation/EnableRetryTests.java
@@ -240,17 +240,19 @@ public class EnableRetryTests {
assertThat(service.getCount()).isEqualTo(9);
RetryConfiguration config = context.getBean(RetryConfiguration.class);
AnnotationAwareRetryOperationsInterceptor advice = (AnnotationAwareRetryOperationsInterceptor) new DirectFieldAccessor(
- config).getPropertyValue("advice");
+ config)
+ .getPropertyValue("advice");
@SuppressWarnings("unchecked")
Map