From e826364ac22efb471eb0f720040a438cabf00027 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Sun, 20 Mar 2016 13:36:56 +0000 Subject: [PATCH] fix eclipse warnings git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735881 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/poifs/crypt/agile/AgileDecryptor.java | 1 + .../crypt/agile/AgileEncryptionInfoBuilder.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java index 9ce0a2b74a..f8c9bb551c 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java @@ -278,6 +278,7 @@ public class AgileDecryptor extends Decryptor { } } + @SuppressWarnings("resource") public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY); _length = dis.readLong(); diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionInfoBuilder.java b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionInfoBuilder.java index 39c6acf742..ecf7fe8e69 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionInfoBuilder.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionInfoBuilder.java @@ -41,21 +41,23 @@ public class AgileEncryptionInfoBuilder implements EncryptionInfoBuilder { AgileDecryptor decryptor; AgileEncryptor encryptor; - public void initialize(EncryptionInfo info, LittleEndianInput dis) throws IOException { - this.info = info; + @Override + public void initialize(EncryptionInfo ei, LittleEndianInput dis) throws IOException { + this.info = ei; EncryptionDocument ed = parseDescriptor((InputStream)dis); header = new AgileEncryptionHeader(ed); verifier = new AgileEncryptionVerifier(ed); - if (info.getVersionMajor() == EncryptionMode.agile.versionMajor - && info.getVersionMinor() == EncryptionMode.agile.versionMinor) { + if (ei.getVersionMajor() == EncryptionMode.agile.versionMajor + && ei.getVersionMinor() == EncryptionMode.agile.versionMinor) { decryptor = new AgileDecryptor(this); encryptor = new AgileEncryptor(this); } } - public void initialize(EncryptionInfo info, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) { - this.info = info; + @Override + public void initialize(EncryptionInfo ei, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) { + this.info = ei; if (cipherAlgorithm == null) { cipherAlgorithm = CipherAlgorithm.aes128; -- 2.39.5