From e5b461d2d3af28556567e6f8e3c501468deb7d00 Mon Sep 17 00:00:00 2001 From: cyb3r4nt <104218001+cyb3r4nt@users.noreply.github.com> Date: Thu, 19 Jan 2023 15:45:29 +0200 Subject: [PATCH] #305: mark com.googlecode.jsonrpc4j.JsonRpcServer#handle(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse) as deprecated Added @Deprecated marker and wrote a comment in the Javadoc Signed-off-by: cyb3r4nt <104218001+cyb3r4nt@users.noreply.github.com> --- build.gradle | 2 +- src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 186e388..017852f 100644 --- a/build.gradle +++ b/build.gradle @@ -93,7 +93,7 @@ dependencies { implementation 'net.iharder:base64:2.3.9' implementation "org.slf4j:slf4j-api:${slf4jVersion}" - + // TODO: remove deprecated portlet-api when support is removed from the code servletSupportImplementation 'javax.portlet:portlet-api:3.0.1' servletSupportImplementation 'javax.servlet:javax.servlet-api:4.0.1' diff --git a/src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java b/src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java index 1a45d20..dad9d4e 100644 --- a/src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java +++ b/src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java @@ -74,12 +74,17 @@ public JsonRpcServer(Object handler) { } /** - * Handles a portlet request. + * (Deprecated) Handles a portlet request. + *

+ * Note: this method is marked for removal. + * Please use {@link JsonRpcBasicServer#handleRequest(InputStream, OutputStream)} instead, + * and propagate request and response data streams to it. * * @param request the {@link ResourceRequest} * @param response the {@link ResourceResponse} * @throws IOException on error */ + @Deprecated public void handle(ResourceRequest request, ResourceResponse response) throws IOException { logger.debug("Handing ResourceRequest {}", request.getMethod()); response.setContentType(contentType);