From 165e7fc637c3d1543e2354406acae9e6d3bbe132 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 29 Oct 2025 20:18:25 -0400 Subject: [PATCH] remove unused no-arg constructor and params, along with logic checking params contents Signed-off-by: Alex --- .../nextcloud/android/sso/PatchMethod.java | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/app/src/main/java/com/nextcloud/android/sso/PatchMethod.java b/app/src/main/java/com/nextcloud/android/sso/PatchMethod.java index 34c5e8b24f05..997682b6864e 100644 --- a/app/src/main/java/com/nextcloud/android/sso/PatchMethod.java +++ b/app/src/main/java/com/nextcloud/android/sso/PatchMethod.java @@ -9,28 +9,12 @@ */ package com.nextcloud.android.sso; -import org.apache.commons.httpclient.methods.ByteArrayRequestEntity; import org.apache.commons.httpclient.methods.EntityEnclosingMethod; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.RequestEntity; -import org.apache.commons.httpclient.util.EncodingUtil; - -import java.util.Vector; public class PatchMethod extends PostMethod { - /** - * The buffered request body consisting of NameValuePairs. - */ - private Vector params = new Vector(); - - /** - * No-arg constructor. - */ - public PatchMethod() { - super(); - } - /** * Constructor specifying a URI. * @@ -58,11 +42,7 @@ public String getName() { * @since 2.0beta1 */ protected boolean hasRequestContent() { - if (!this.params.isEmpty()) { - return true; - } else { - return super.hasRequestContent(); - } + return super.hasRequestContent(); } /** @@ -71,7 +51,6 @@ protected boolean hasRequestContent() { * @since 2.0beta1 */ protected void clearRequestBody() { - this.params.clear(); super.clearRequestBody(); } @@ -82,19 +61,6 @@ protected void clearRequestBody() { * @since 3.0 */ protected RequestEntity generateRequestEntity() { - if (!this.params.isEmpty()) { - // Use a ByteArrayRequestEntity instead of a StringRequestEntity. - // This is to avoid potential encoding issues. Form url encoded strings - // are ASCII by definition but the content type may not be. Treating the content - // as bytes allows us to keep the current charset without worrying about how - // this charset will effect the encoding of the form url encoded string. - String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet()); - return new ByteArrayRequestEntity( - EncodingUtil.getAsciiBytes(content), - FORM_URL_ENCODED_CONTENT_TYPE - ); - } else { - return super.generateRequestEntity(); - } + return super.generateRequestEntity(); } }