Skip to content

Commit 8cd308b

Browse files
authored
Generate metadata for reflection on method parameters (#3377)
Fixes #3342
1 parent 07f47a3 commit 8cd308b

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.codahale.metrics;
2+
3+
import org.junit.Test;
4+
5+
import static org.assertj.core.api.Assertions.assertThat;
6+
7+
public class ClassMetadataTest {
8+
@Test
9+
public void testParameterMetadataIsAvailable() throws NoSuchMethodException {
10+
assertThat(DefaultSettableGauge.class.getConstructor(Object.class).getParameters())
11+
.allSatisfy(parameter -> assertThat(parameter.isNamePresent()).isTrue());
12+
}
13+
}

pom.xml

+2-5
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@
146146
<plugin>
147147
<groupId>org.apache.maven.plugins</groupId>
148148
<artifactId>maven-compiler-plugin</artifactId>
149-
<version>${maven-compiler-plugin.version}</version>
150149
<configuration>
151-
<fork>true</fork>
152150
<compilerArgs combine.children="append">
153151
<arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${errorprone.javac.version}/javac-${errorprone.javac.version}.jar</arg>
154152
</compilerArgs>
@@ -167,9 +165,7 @@
167165
<plugin>
168166
<groupId>org.apache.maven.plugins</groupId>
169167
<artifactId>maven-compiler-plugin</artifactId>
170-
<version>${maven-compiler-plugin.version}</version>
171168
<configuration>
172-
<fork>true</fork>
173169
<compilerArgs>
174170
<arg>-Xlint:all</arg>
175171
<arg>-XDcompilePolicy=simple</arg>
@@ -318,10 +314,11 @@
318314
<plugin>
319315
<groupId>org.apache.maven.plugins</groupId>
320316
<artifactId>maven-compiler-plugin</artifactId>
321-
<version>${maven-compiler-plugin.version}</version>
322317
<configuration>
323318
<source>1.8</source>
324319
<target>1.8</target>
320+
<fork>true</fork>
321+
<parameters>true</parameters>
325322
<showWarnings>true</showWarnings>
326323
<compilerArgs>
327324
<arg>-Xlint:all</arg>

0 commit comments

Comments
 (0)