From 3b41c876c82ef6ceed5b560308a5b19284d399e9 Mon Sep 17 00:00:00 2001 From: Jonatan Ivanov Date: Thu, 19 Sep 2024 16:13:27 -0700 Subject: [PATCH] Fix compile error on Java 11 in TimedAspectTest --- .../micrometer/core/aop/TimedAspectTest.java | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/micrometer-core/src/test/java/io/micrometer/core/aop/TimedAspectTest.java b/micrometer-core/src/test/java/io/micrometer/core/aop/TimedAspectTest.java index 3c4acd3e85..51a3515df4 100644 --- a/micrometer-core/src/test/java/io/micrometer/core/aop/TimedAspectTest.java +++ b/micrometer-core/src/test/java/io/micrometer/core/aop/TimedAspectTest.java @@ -475,100 +475,100 @@ void meterTagOnSuperClass() { assertThat(registry.get("method.timed").tag("superTag", "someValue").timer().count()).isEqualTo(1); } - enum AnnotatedTestClass { + } - CLASS_WITHOUT_INTERFACE(MeterTagClass.class), CLASS_WITH_INTERFACE(MeterTagClassChild.class); + enum AnnotatedTestClass { - private final Class clazz; + CLASS_WITHOUT_INTERFACE(MeterTagClass.class), CLASS_WITH_INTERFACE(MeterTagClassChild.class); - AnnotatedTestClass(Class clazz) { - this.clazz = clazz; - } + private final Class clazz; - @SuppressWarnings("unchecked") - T newInstance() { - try { - return (T) clazz.getDeclaredConstructor().newInstance(); - } - catch (Exception e) { - throw new RuntimeException(e); - } - } + AnnotatedTestClass(Class clazz) { + this.clazz = clazz; + } + @SuppressWarnings("unchecked") + T newInstance() { + try { + return (T) clazz.getDeclaredConstructor().newInstance(); + } + catch (Exception e) { + throw new RuntimeException(e); + } } - interface MeterTagClassInterface { + } - @Timed - void getAnnotationForTagValueResolver(@MeterTag(key = "test", resolver = ValueResolver.class) String test); + interface MeterTagClassInterface { - @Timed - void getAnnotationForTagValueExpression( - @MeterTag(key = "test", expression = "'hello' + ' characters'") String test); + @Timed + void getAnnotationForTagValueResolver(@MeterTag(key = "test", resolver = ValueResolver.class) String test); - @Timed - void getAnnotationForArgumentToString(@MeterTag("test") Long param); + @Timed + void getAnnotationForTagValueExpression( + @MeterTag(key = "test", expression = "'hello' + ' characters'") String test); - } + @Timed + void getAnnotationForArgumentToString(@MeterTag("test") Long param); - static class MeterTagClass implements MeterTagClassInterface { + } - @Timed - @Override - public void getAnnotationForTagValueResolver( - @MeterTag(key = "test", resolver = ValueResolver.class) String test) { - } + static class MeterTagClass implements MeterTagClassInterface { - @Timed - @Override - public void getAnnotationForTagValueExpression( - @MeterTag(key = "test", expression = "'hello' + ' characters'") String test) { - } + @Timed + @Override + public void getAnnotationForTagValueResolver( + @MeterTag(key = "test", resolver = ValueResolver.class) String test) { + } - @Timed - @Override - public void getAnnotationForArgumentToString(@MeterTag("test") Long param) { - } + @Timed + @Override + public void getAnnotationForTagValueExpression( + @MeterTag(key = "test", expression = "'hello' + ' characters'") String test) { + } - @Timed - void getAnnotationForPackagePrivateMethod(@MeterTag("foo") String foo) { - } + @Timed + @Override + public void getAnnotationForArgumentToString(@MeterTag("test") Long param) { + } + @Timed + void getAnnotationForPackagePrivateMethod(@MeterTag("foo") String foo) { } - static class MeterTagClassChild implements MeterTagClassInterface { + } - @Timed - @Override - public void getAnnotationForTagValueResolver(String test) { - } + static class MeterTagClassChild implements MeterTagClassInterface { - @Timed - @Override - public void getAnnotationForTagValueExpression(String test) { - } + @Timed + @Override + public void getAnnotationForTagValueResolver(String test) { + } - @Timed - @Override - public void getAnnotationForArgumentToString(Long param) { - } + @Timed + @Override + public void getAnnotationForTagValueExpression(String test) { + } + @Timed + @Override + public void getAnnotationForArgumentToString(Long param) { } - static class MeterTagSuper { + } - @Timed - public void superMethod(@MeterTag("superTag") String foo) { - } + static class MeterTagSuper { + @Timed + public void superMethod(@MeterTag("superTag") String foo) { } - static class MeterTagSub extends MeterTagSuper { + } - @Timed - public void subMethod(@MeterTag("subTag") String foo) { - } + static class MeterTagSub extends MeterTagSuper { + @Timed + public void subMethod(@MeterTag("subTag") String foo) { } }