You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/08/05 16:19:20 UTC

[commons-crypto] branch master updated (4d6b04d -> 5a3dab1)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git.


    from 4d6b04d  Use try-with-resources.
     new c479c52  No need to override stock methods and implement them exactly the same way.
     new 5a3dab1  Remove compiler warning and document.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commons/crypto/stream/CryptoInputStream.java   | 25 ++--------------------
 1 file changed, 2 insertions(+), 23 deletions(-)


[commons-crypto] 02/02: Remove compiler warning and document.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git

commit 5a3dab19d63dd2a89bfb51faf142a91a72141ded
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 5 12:17:55 2020 -0400

    Remove compiler warning and document.
---
 src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java b/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
index 37e1012..722df6b 100644
--- a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
+++ b/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
@@ -138,6 +138,7 @@ public class CryptoInputStream extends InputStream implements
      * @param params the algorithm parameters.
      * @throws IOException if an I/O error occurs.
      */
+    @SuppressWarnings("resource") // The CryptoCipher returned by getCipherInstance() is closed by CryptoInputStream.
     public CryptoInputStream(final String transformation,
             final Properties props, final ReadableByteChannel in, final Key key,
             final AlgorithmParameterSpec params) throws IOException {


[commons-crypto] 01/02: No need to override stock methods and implement them exactly the same way.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git

commit c479c5249fcea07fcec172d1b527d3c439c4b58b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 5 12:17:18 2020 -0400

    No need to override stock methods and implement them exactly the same
    way.
---
 .../commons/crypto/stream/CryptoInputStream.java   | 24 +---------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java b/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
index ff8912f..37e1012 100644
--- a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
+++ b/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
@@ -116,6 +116,7 @@ public class CryptoInputStream extends InputStream implements
      * @param params the algorithm parameters.
      * @throws IOException if an I/O error occurs.
      */
+    @SuppressWarnings("resource") // The CryptoCipher returned by getCipherInstance() is closed by CryptoInputStream.
     public CryptoInputStream(final String transformation,
             final Properties props, final InputStream in, final Key key,
             final AlgorithmParameterSpec params) throws IOException {
@@ -353,29 +354,6 @@ public class CryptoInputStream extends InputStream implements
     }
 
     /**
-     * Overrides the {@link java.io.InputStream#mark(int)}. For
-     * {@link CryptoInputStream},we don't support the mark method.
-     *
-     * @param readlimit the maximum limit of bytes that can be read before the
-     *        mark position becomes invalid.
-     */
-    @Override
-    public void mark(final int readlimit) {
-        // noop
-    }
-
-    /**
-     * Overrides the {@link InputStream#reset()}. For {@link CryptoInputStream}
-     * ,we don't support the reset method.
-     *
-     * @throws IOException if an I/O error occurs.
-     */
-    @Override
-    public void reset() throws IOException {
-        throw new IOException("Mark/reset not supported");
-    }
-
-    /**
      * Overrides the {@link InputStream#markSupported()}.
      *
      * @return false,the {@link CtrCryptoInputStream} don't support the mark