fix eclipse warnings

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735881 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2016-03-20 13:36:56 +00:00
parent 5741c62ab0
commit 8be67e1910
2 changed files with 9 additions and 6 deletions

View File

@ -278,6 +278,7 @@ public class AgileDecryptor extends Decryptor {
} }
} }
@SuppressWarnings("resource")
public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException {
DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY); DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY);
_length = dis.readLong(); _length = dis.readLong();

View File

@ -41,21 +41,23 @@ public class AgileEncryptionInfoBuilder implements EncryptionInfoBuilder {
AgileDecryptor decryptor; AgileDecryptor decryptor;
AgileEncryptor encryptor; AgileEncryptor encryptor;
public void initialize(EncryptionInfo info, LittleEndianInput dis) throws IOException { @Override
this.info = info; public void initialize(EncryptionInfo ei, LittleEndianInput dis) throws IOException {
this.info = ei;
EncryptionDocument ed = parseDescriptor((InputStream)dis); EncryptionDocument ed = parseDescriptor((InputStream)dis);
header = new AgileEncryptionHeader(ed); header = new AgileEncryptionHeader(ed);
verifier = new AgileEncryptionVerifier(ed); verifier = new AgileEncryptionVerifier(ed);
if (info.getVersionMajor() == EncryptionMode.agile.versionMajor if (ei.getVersionMajor() == EncryptionMode.agile.versionMajor
&& info.getVersionMinor() == EncryptionMode.agile.versionMinor) { && ei.getVersionMinor() == EncryptionMode.agile.versionMinor) {
decryptor = new AgileDecryptor(this); decryptor = new AgileDecryptor(this);
encryptor = new AgileEncryptor(this); encryptor = new AgileEncryptor(this);
} }
} }
public void initialize(EncryptionInfo info, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) { @Override
this.info = info; public void initialize(EncryptionInfo ei, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) {
this.info = ei;
if (cipherAlgorithm == null) { if (cipherAlgorithm == null) {
cipherAlgorithm = CipherAlgorithm.aes128; cipherAlgorithm = CipherAlgorithm.aes128;