From 6bca836f49b6388d6f4f01174979dc6b0a78f4e2 Mon Sep 17 00:00:00 2001 From: Thomas Koch Date: Sat, 11 Feb 2023 17:17:46 +0200 Subject: [PATCH] fix 3 javac warnings: redundant cast see GitHub issue #561 for context [javac] /home/thk/git/yacy_search_server/source/net/yacy/htroot/ConfigAccounts_p.java:85: warning: [cast] redundant cast to YaCyHttpServer [javac] final YaCyHttpServer jhttpserver = (YaCyHttpServer)sb.getHttpServer(); [javac] ^ [javac] /home/thk/git/yacy_search_server/source/net/yacy/htroot/ConfigUser_p.java:156: warning: [cast] redundant cast to YaCyHttpServer [javac] final YaCyHttpServer jhttpserver = (YaCyHttpServer) sb.getHttpServer(); [javac] ^ [javac] /home/thk/git/yacy_search_server/source/net/yacy/htroot/ConfigUser_p.java:167: warning: [cast] redundant cast to YaCyHttpServer [javac] final YaCyHttpServer jhttpserver = (YaCyHttpServer) sb.getHttpServer(); --- source/net/yacy/htroot/ConfigAccounts_p.java | 2 +- source/net/yacy/htroot/ConfigUser_p.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/yacy/htroot/ConfigAccounts_p.java b/source/net/yacy/htroot/ConfigAccounts_p.java index 053ed4c68..293944620 100644 --- a/source/net/yacy/htroot/ConfigAccounts_p.java +++ b/source/net/yacy/htroot/ConfigAccounts_p.java @@ -82,7 +82,7 @@ public class ConfigAccounts_p { env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, sb.encodeDigestAuth(user, pw1)); env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME,user); // make sure server accepts new credentials - final YaCyHttpServer jhttpserver = (YaCyHttpServer)sb.getHttpServer(); + final YaCyHttpServer jhttpserver = sb.getHttpServer(); if (!user.equals(oldusername)) jhttpserver.removeUser(oldusername); jhttpserver.resetUser(user); } else { diff --git a/source/net/yacy/htroot/ConfigUser_p.java b/source/net/yacy/htroot/ConfigUser_p.java index b567b5c6b..9a5360662 100644 --- a/source/net/yacy/htroot/ConfigUser_p.java +++ b/source/net/yacy/htroot/ConfigUser_p.java @@ -153,7 +153,7 @@ public class ConfigUser_p { } catch (final Exception e) { ConcurrentLog.logException(e); } - final YaCyHttpServer jhttpserver = (YaCyHttpServer) sb.getHttpServer(); + final YaCyHttpServer jhttpserver = sb.getHttpServer(); jhttpserver.resetUser(entry.getUserName()); } else { prop.put("error", "1"); @@ -164,7 +164,7 @@ public class ConfigUser_p { prop.putHTML("username", username); } else if (post.containsKey("delete")) { sb.userDB.removeEntry(post.get("username")); - final YaCyHttpServer jhttpserver = (YaCyHttpServer) sb.getHttpServer(); + final YaCyHttpServer jhttpserver = sb.getHttpServer(); jhttpserver.removeUser(post.get("username")); prop.put(serverObjects.ACTION_LOCATION, "ConfigAccountList_p.html"); // jump back to user list }