code warnings cleanup

This commit is contained in:
nathan 2015-11-02 18:10:44 +01:00
parent 13a9620585
commit 487473edb8

View File

@ -54,6 +54,7 @@ class Sys {
// If you want to be able to use it as an entry in a set or as a value in map, // If you want to be able to use it as an entry in a set or as a value in map,
// you will need to recalculate the hash code and set the value of the hashCode field. // you will need to recalculate the hash code and set the value of the hashCode field.
//noinspection TryWithIdenticalCatches
try { try {
Field valueField = String.class.getDeclaredField("value"); Field valueField = String.class.getDeclaredField("value");
valueField.setAccessible(true); valueField.setAccessible(true);
@ -161,6 +162,7 @@ class Sys {
/** /**
* Convenient close for a stream. * Convenient close for a stream.
*/ */
@SuppressWarnings("Duplicates")
public static public static
void close(InputStream inputStream) { void close(InputStream inputStream) {
if (inputStream != null) { if (inputStream != null) {
@ -176,6 +178,7 @@ class Sys {
/** /**
* Convenient close for a stream. * Convenient close for a stream.
*/ */
@SuppressWarnings("Duplicates")
public static public static
void close(OutputStream outputStream) { void close(OutputStream outputStream) {
if (outputStream != null) { if (outputStream != null) {
@ -191,6 +194,7 @@ class Sys {
/** /**
* Convenient close for a Reader. * Convenient close for a Reader.
*/ */
@SuppressWarnings("Duplicates")
public static public static
void close(Reader inputReader) { void close(Reader inputReader) {
if (inputReader != null) { if (inputReader != null) {
@ -206,6 +210,7 @@ class Sys {
/** /**
* Convenient close for a Writer. * Convenient close for a Writer.
*/ */
@SuppressWarnings("Duplicates")
public static public static
void close(Writer outputWriter) { void close(Writer outputWriter) {
if (outputWriter != null) { if (outputWriter != null) {
@ -338,6 +343,7 @@ class Sys {
/** /**
* this saves the char array in UTF-16 format of bytes * this saves the char array in UTF-16 format of bytes
*/ */
@SuppressWarnings("NumericCastThatLosesPrecision")
public static public static
byte[] charToBytes(char[] text) { byte[] charToBytes(char[] text) {
// NOTE: this saves the char array in UTF-16 format of bytes. // NOTE: this saves the char array in UTF-16 format of bytes.
@ -369,6 +375,7 @@ class Sys {
return bytes; return bytes;
} }
@SuppressWarnings("NumericCastThatLosesPrecision")
public static public static
byte[] charToBytesRaw(char[] chars) { byte[] charToBytesRaw(char[] chars) {
int length = chars.length; int length = chars.length;
@ -514,6 +521,7 @@ class Sys {
* @param originalArray this is the base of the XOR operation. * @param originalArray this is the base of the XOR operation.
* @param keyArray this is XOR'd into the original array, repeats if necessary. * @param keyArray this is XOR'd into the original array, repeats if necessary.
*/ */
@SuppressWarnings("NumericCastThatLosesPrecision")
public static public static
void xorArrays(byte[] originalArray, byte[] keyArray) { void xorArrays(byte[] originalArray, byte[] keyArray) {
int keyIndex = 0; int keyIndex = 0;