Skip to content

Commit 376dee8

Browse files
committed
Get rid of parameternames dependency
Since we are on JDK 17 now, this is no longer needed
1 parent fcfdec1 commit 376dee8

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@
4040
<scope>test</scope>
4141
</dependency>
4242

43-
<dependency>
44-
<groupId>io.airlift</groupId>
45-
<artifactId>parameternames</artifactId>
46-
<version>1.5</version>
47-
</dependency>
48-
4943
<dependency>
5044
<groupId>com.google.inject</groupId>
5145
<artifactId>guice</artifactId>

src/main/java/org/weakref/jmx/MBeanOperationBuilder.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121

2222
import java.lang.annotation.Annotation;
2323
import java.lang.reflect.Method;
24+
import java.lang.reflect.Parameter;
25+
import java.util.Arrays;
2426
import java.util.List;
2527

2628
import static com.google.common.base.Preconditions.checkArgument;
27-
import static io.airlift.parameternames.ParameterNames.getParameterNames;
2829
import static java.util.Objects.requireNonNull;
30+
import static java.util.stream.Collectors.toUnmodifiableList;
2931

3032
public class MBeanOperationBuilder
3133
{
@@ -71,7 +73,10 @@ public MBeanOperation build()
7173

7274
//
7375
// Build Parameter Infos
74-
List<String> parameterNames = getParameterNames(concreteMethod);
76+
List<String> parameterNames = Arrays.stream(concreteMethod.getParameters())
77+
.map(Parameter::getName)
78+
.collect(toUnmodifiableList());
79+
7580
Class<?>[] types = concreteMethod.getParameterTypes();
7681

7782
// Parameter annotations used form descriptor come from the annotated method, not the public method

0 commit comments

Comments
 (0)