diff --git a/org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/services/ServiceEndpoints.java b/org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/services/ServiceEndpoints.java index c8ad3f011..0d67dda9f 100644 --- a/org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/services/ServiceEndpoints.java +++ b/org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/services/ServiceEndpoints.java @@ -99,8 +99,8 @@ private static Map getSupportedMethods(Class type, Set ResponseJsonAdapter responseTypeAdapterAnnotation = methodInfo.method.getAnnotation(ResponseJsonAdapter.class); if (responseTypeAdapterAnnotation != null) { try { - responseTypeAdapter = responseTypeAdapterAnnotation.value().newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + responseTypeAdapter = responseTypeAdapterAnnotation.value().getDeclaredConstructor().newInstance(); + } catch (ReflectiveOperationException e) { throw new RuntimeException(e); } }