add @SuppressWarnings(unchecked)

master
YuQing 2023-01-29 14:47:09 +08:00
parent 1b263e6436
commit 42132c694c
3 changed files with 3 additions and 3 deletions

View File

@ -155,13 +155,13 @@ public class IniFileReader {
} finally { } finally {
try { try {
if (in != null) in.close(); if (in != null) in.close();
//System.out.println("loadFrom...finally...in.close(); done");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
} }
} }
@SuppressWarnings("unchecked")
private void readToParamTable(InputStream in) throws IOException { private void readToParamTable(InputStream in) throws IOException {
this.paramTable = new Hashtable(); this.paramTable = new Hashtable();
if (in == null) return; if (in == null) return;
@ -206,7 +206,6 @@ public class IniFileReader {
try { try {
if (bufferedReader != null) bufferedReader.close(); if (bufferedReader != null) bufferedReader.close();
if (inReader != null) inReader.close(); if (inReader != null) inReader.close();
//System.out.println("readToParamTable...finally...bufferedReader.close();inReader.close(); done");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }

View File

@ -219,7 +219,7 @@ public class ClientGlobal {
* server',' * server','
*/ */
public static void initByTrackers(String trackerServers) throws IOException, MyException { public static void initByTrackers(String trackerServers) throws IOException, MyException {
List<InetSocketAddress> list = new ArrayList(); List<InetSocketAddress> list = new ArrayList<InetSocketAddress>();
String spr1 = ","; String spr1 = ",";
String spr2 = ":"; String spr2 = ":";
String[] arr1 = trackerServers.trim().split(spr1); String[] arr1 = trackerServers.trim().split(spr1);

View File

@ -27,6 +27,7 @@ public class ProtoStructDecoder<T extends StructBase> {
/** /**
* decode byte buffer * decode byte buffer
*/ */
@SuppressWarnings("unchecked")
public T[] decode(byte[] bs, Class<T> clazz, int fieldsTotalSize) throws Exception { public T[] decode(byte[] bs, Class<T> clazz, int fieldsTotalSize) throws Exception {
if (bs.length % fieldsTotalSize != 0) { if (bs.length % fieldsTotalSize != 0) {
throw new IOException("byte array length: " + bs.length + " is invalid!"); throw new IOException("byte array length: " + bs.length + " is invalid!");