Skip to content

Commit

Permalink
Jersey 3.1.9: java.lang.NoSuchMethodException: jakarta.inject.Inject.…
Browse files Browse the repository at this point in the history
…value() #5782

Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos committed Oct 29, 2024
1 parent c2e1271 commit bb8149b
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -447,14 +447,20 @@ protected static <PARAMETER extends org.glassfish.jersey.model.Parameter> List<P
parameterClass);
}


private static String getValue(Annotation a) {
try {
Method m = a.annotationType().getMethod("value");
if (m.getReturnType() != String.class) {
return null;
Method[] methods = a.annotationType().getMethods();
for (Method method : methods) {
if ("value".equals(method.getName())) {
if (method.getReturnType() != String.class) {
return null;
} else {
return (String) method.invoke(a);
}
}
}
return (String) m.invoke(a);
LOGGER.log(Level.FINER, () ->
String.format("Unable to get the %s annotation value property", a.getClass().getName()));
} catch (Exception ex) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER,
Expand Down

0 comments on commit bb8149b

Please sign in to comment.