Style fixes

This commit is contained in:
Ethan Roseman 2019-12-06 11:09:41 -05:00
parent afa20497d6
commit 23f41b507d

View File

@ -808,7 +808,7 @@ class SevenZipExtractor {
return unpackSuccessful; return unpackSuccessful;
} }
private Charset detectFilenamesCharset(ArrayList<byte[]> byteDatas) { private Charset detectFilenamesCharset(List<byte[]> byteDatas) {
Charset detectedCharset = null; Charset detectedCharset = null;
CharsetDetector charsetDetector = new CharsetDetector(); CharsetDetector charsetDetector = new CharsetDetector();
int byteSum = 0; int byteSum = 0;
@ -830,10 +830,8 @@ class SevenZipExtractor {
} }
charsetDetector.setText(allBytes); charsetDetector.setText(allBytes);
CharsetMatch cm = charsetDetector.detect(); CharsetMatch cm = charsetDetector.detect();
if (cm.getConfidence() >= 90) { if (cm.getConfidence() >= 90 && Charset.isSupported(cm.getName())) {
if (Charset.isSupported(cm.getName())) { detectedCharset = Charset.forName(cm.getName());
detectedCharset = Charset.forName(cm.getName());
}
} }
return detectedCharset; return detectedCharset;
} }