You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/01/07 13:46:14 UTC

[GitHub] [commons-crypto] garydgregory commented on a change in pull request #128: Minor Performances Improvement:

garydgregory commented on a change in pull request #128:
URL: https://github.com/apache/commons-crypto/pull/128#discussion_r553332403



##########
File path: src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java
##########
@@ -587,10 +587,10 @@ static void freeDirectBuffer(final ByteBuffer buffer) {
             .clean(); */
             final String SUN_CLASS = "sun.nio.ch.DirectBuffer";
             final Class<?>[] interfaces = buffer.getClass().getInterfaces();
+            final Object[] NO_PARAM = new Object[0];

Review comment:
       You can use the same name we have in Commons Lang: EMPTY_OBJECT_ARRAY.

##########
File path: src/main/java/org/apache/commons/crypto/NativeCodeLoader.java
##########
@@ -171,7 +171,7 @@ private static File extractLibraryFile(final String libFolderForCurrentOS, final
             // Check whether the contents are properly copied from the resource
             // folder
             try (InputStream nativeInputStream = NativeCodeLoader.class.getResourceAsStream(nativeLibraryFilePath)) {
-                try (InputStream extractedLibIn = new FileInputStream(extractedLibFile)) {
+                try (InputStream extractedLibIn = Files.newInputStream(Paths.get(extractedLibFile.getPath()))) {

Review comment:
       See line 148 above, already a path I think.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org