Skip to content

Commit

Permalink
Generate metadata for reflection on method parameters (#3377)
Browse files Browse the repository at this point in the history
Fixes #3342
  • Loading branch information
joschi committed May 30, 2023
1 parent 07f47a3 commit 8cd308b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
@@ -0,0 +1,13 @@
package com.codahale.metrics;

import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class ClassMetadataTest {
@Test
public void testParameterMetadataIsAvailable() throws NoSuchMethodException {
assertThat(DefaultSettableGauge.class.getConstructor(Object.class).getParameters())
.allSatisfy(parameter -> assertThat(parameter.isNamePresent()).isTrue());
}
}
7 changes: 2 additions & 5 deletions pom.xml
Expand Up @@ -146,9 +146,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<fork>true</fork>
<compilerArgs combine.children="append">
<arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${errorprone.javac.version}/javac-${errorprone.javac.version}.jar</arg>
</compilerArgs>
Expand All @@ -167,9 +165,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<fork>true</fork>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-XDcompilePolicy=simple</arg>
Expand Down Expand Up @@ -318,10 +314,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<parameters>true</parameters>
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>-Xlint:all</arg>
Expand Down

0 comments on commit 8cd308b

Please sign in to comment.