Skip to content

Commit

Permalink
polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Squiry committed Aug 7, 2023
1 parent 762e8b6 commit 8630308
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.tinkoff.kora.resilient.annotation.processor.aop;

import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.CodeBlock;
import ru.tinkoff.kora.annotation.processor.common.MethodUtils;
import ru.tinkoff.kora.annotation.processor.common.ProcessingError;
Expand Down Expand Up @@ -74,7 +75,7 @@ private CodeBlock buildBodySync(ExecutableElement method, String superCall, Stri
? CodeBlock.of("return")
: CodeBlock.of("return t", superMethod.toString());

final DeclaredType cbException = env.getTypeUtils().getDeclaredType(env.getElementUtils().getTypeElement("ru.tinkoff.kora.resilient.timeout.TimeoutExhaustedException"));
final ClassName cbException = ClassName.get("ru.tinkoff.kora.resilient.timeout", "TimeoutExhaustedException");

return CodeBlock.builder().add("""
var _circuitBreaker = $L;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ru.tinkoff.kora.resilient.annotation.processor.aop;

import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.CodeBlock;
import ru.tinkoff.kora.annotation.processor.common.MethodUtils;
import ru.tinkoff.kora.annotation.processor.common.ProcessingErrorException;
Expand Down Expand Up @@ -85,7 +86,7 @@ private CodeBlock buildBodySync(ExecutableElement method, String superCall, Stri

private CodeBlock buildBodyMono(ExecutableElement method, String superCall, String timeoutName, String fieldTimeout, String fieldMetrics) {
final CodeBlock superMethod = buildMethodCall(method, superCall);
final DeclaredType timeoutException = env.getTypeUtils().getDeclaredType(env.getElementUtils().getTypeElement("ru.tinkoff.kora.resilient.timeout.TimeoutExhaustedException"));
final ClassName timeoutException = ClassName.get("ru.tinkoff.kora.resilient.timeout", "TimeoutExhaustedException");

return CodeBlock.builder().add("""
return $L
Expand All @@ -102,7 +103,7 @@ private CodeBlock buildBodyMono(ExecutableElement method, String superCall, Stri

private CodeBlock buildBodyFlux(ExecutableElement method, String superCall, String timeoutName, String fieldTimeout, String fieldMetrics) {
final CodeBlock superMethod = buildMethodCall(method, superCall);
final DeclaredType timeoutException = env.getTypeUtils().getDeclaredType(env.getElementUtils().getTypeElement("ru.tinkoff.kora.resilient.timeout.TimeoutExhaustedException"));
final ClassName timeoutException = ClassName.get("ru.tinkoff.kora.resilient.timeout", "TimeoutExhaustedException");

return CodeBlock.builder().add("""
return $L
Expand Down

0 comments on commit 8630308

Please sign in to comment.