Skip to content

Commit

Permalink
Fix compile error on Java 11 in TimedAspectTest
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatan-ivanov committed Sep 19, 2024
1 parent 9adf526 commit 3b41c87
Showing 1 changed file with 63 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<? extends MeterTagClassInterface> clazz;
CLASS_WITHOUT_INTERFACE(MeterTagClass.class), CLASS_WITH_INTERFACE(MeterTagClassChild.class);

AnnotatedTestClass(Class<? extends MeterTagClassInterface> clazz) {
this.clazz = clazz;
}
private final Class<? extends MeterTagClassInterface> clazz;

@SuppressWarnings("unchecked")
<T extends MeterTagClassInterface> T newInstance() {
try {
return (T) clazz.getDeclaredConstructor().newInstance();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
AnnotatedTestClass(Class<? extends MeterTagClassInterface> clazz) {
this.clazz = clazz;
}

@SuppressWarnings("unchecked")
<T extends MeterTagClassInterface> 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) {
}

}
Expand Down

0 comments on commit 3b41c87

Please sign in to comment.