Skip to content

Commit d649f4b

Browse files
committed
update Base64.java : cleanup code, fix EmptyCatchBlock and LocalVariableName
1 parent d06cff2 commit d649f4b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/org/java_websocket/util/Base64.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ private static byte[] encode3to4(
517517
byte[] source, int srcOffset, int numSigBytes,
518518
byte[] destination, int destOffset, int options) {
519519

520-
byte[] ALPHABET = getAlphabet(options);
520+
final byte[] ALPHABET = getAlphabet(options);
521521

522522
// 1 2 3
523523
// 01234567890123456789012345678901 Bit position
@@ -691,18 +691,21 @@ public static byte[] encodeBytesToBytes(byte[] source, int off, int len, int opt
691691
gzos.close();
692692
}
693693
} catch (Exception e) {
694+
// do nothing
694695
}
695696
try {
696697
if (b64os != null) {
697698
b64os.close();
698699
}
699700
} catch (Exception e) {
701+
// do nothing
700702
}
701703
try {
702704
if (baos != null) {
703705
baos.close();
704706
}
705707
} catch (Exception e) {
708+
// do nothing
706709
}
707710
} // end finally
708711

@@ -818,7 +821,7 @@ private static int decode4to3(
818821
destination.length, destOffset));
819822
} // end if
820823

821-
byte[] DECODABET = getDecodabet(options);
824+
final byte[] DECODABET = getDecodabet(options);
822825

823826
// Example: Dk==
824827
if (source[srcOffset + 2] == EQUALS_SIGN) {

0 commit comments

Comments
 (0)