From 42132c694ccf2da8363d09ccf3622a4bb86a474e Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Sun, 29 Jan 2023 14:47:09 +0800 Subject: [PATCH] add @SuppressWarnings(unchecked) --- src/main/java/org/csource/common/IniFileReader.java | 3 +-- src/main/java/org/csource/fastdfs/ClientGlobal.java | 2 +- src/main/java/org/csource/fastdfs/ProtoStructDecoder.java | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/csource/common/IniFileReader.java b/src/main/java/org/csource/common/IniFileReader.java index e1c609c..3146635 100644 --- a/src/main/java/org/csource/common/IniFileReader.java +++ b/src/main/java/org/csource/common/IniFileReader.java @@ -155,13 +155,13 @@ public class IniFileReader { } finally { try { if (in != null) in.close(); - //System.out.println("loadFrom...finally...in.close(); done"); } catch (Exception ex) { ex.printStackTrace(); } } } + @SuppressWarnings("unchecked") private void readToParamTable(InputStream in) throws IOException { this.paramTable = new Hashtable(); if (in == null) return; @@ -206,7 +206,6 @@ public class IniFileReader { try { if (bufferedReader != null) bufferedReader.close(); if (inReader != null) inReader.close(); - //System.out.println("readToParamTable...finally...bufferedReader.close();inReader.close(); done"); } catch (Exception ex) { ex.printStackTrace(); } diff --git a/src/main/java/org/csource/fastdfs/ClientGlobal.java b/src/main/java/org/csource/fastdfs/ClientGlobal.java index af00000..98e763d 100644 --- a/src/main/java/org/csource/fastdfs/ClientGlobal.java +++ b/src/main/java/org/csource/fastdfs/ClientGlobal.java @@ -219,7 +219,7 @@ public class ClientGlobal { * server之间用逗号','分隔 */ public static void initByTrackers(String trackerServers) throws IOException, MyException { - List list = new ArrayList(); + List list = new ArrayList(); String spr1 = ","; String spr2 = ":"; String[] arr1 = trackerServers.trim().split(spr1); diff --git a/src/main/java/org/csource/fastdfs/ProtoStructDecoder.java b/src/main/java/org/csource/fastdfs/ProtoStructDecoder.java index f6b9d9f..07dec45 100644 --- a/src/main/java/org/csource/fastdfs/ProtoStructDecoder.java +++ b/src/main/java/org/csource/fastdfs/ProtoStructDecoder.java @@ -27,6 +27,7 @@ public class ProtoStructDecoder { /** * decode byte buffer */ + @SuppressWarnings("unchecked") public T[] decode(byte[] bs, Class clazz, int fieldsTotalSize) throws Exception { if (bs.length % fieldsTotalSize != 0) { throw new IOException("byte array length: " + bs.length + " is invalid!");