Fix some statically detected code issues

This includes: unnecessary semicolons, suppress warnings, switch statements, final/private qualifiers, Optional wrapping, conditionals, both inline and non-inline variables, ternaries, Collection putAll() calls, StringBuilders, and throws declarations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244182539
This commit is contained in:
mcilwain 2019-04-18 07:34:10 -07:00 committed by jianglai
parent 9f360587ff
commit 24bb78bd16
54 changed files with 107 additions and 158 deletions

View file

@ -54,10 +54,6 @@ public final class RydeEncoder extends FilterOutputStream {
private final OutputStream sigOutput;
private final RydePgpSigningOutputStream signer;
private final OutputStream encryptLayer;
private final OutputStream kompressor;
private final OutputStream fileLayer;
private final OutputStream tarLayer;
// We use a Closer to handle the stream .close, to make sure it's done correctly.
private final Closer closer = Closer.create();
private boolean isClosed = false;
@ -73,10 +69,12 @@ public final class RydeEncoder extends FilterOutputStream {
super(null);
this.sigOutput = sigOutput;
signer = closer.register(new RydePgpSigningOutputStream(checkNotNull(rydeOutput), signingKey));
encryptLayer = closer.register(openEncryptor(signer, RYDE_USE_INTEGRITY_PACKET, receiverKeys));
kompressor = closer.register(openCompressor(encryptLayer));
fileLayer = closer.register(openPgpFileWriter(kompressor, filenamePrefix + ".tar", modified));
tarLayer =
OutputStream encryptLayer =
closer.register(openEncryptor(signer, RYDE_USE_INTEGRITY_PACKET, receiverKeys));
OutputStream kompressor = closer.register(openCompressor(encryptLayer));
OutputStream fileLayer =
closer.register(openPgpFileWriter(kompressor, filenamePrefix + ".tar", modified));
OutputStream tarLayer =
closer.register(openTarWriter(fileLayer, dataLength, filenamePrefix + ".xml", modified));
this.out = tarLayer;
}