arturobernalg commented on a change in pull request #129:
URL: https://github.com/apache/commons-crypto/pull/129#discussion_r553881334



##########
File path: src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java
##########
@@ -74,7 +76,7 @@ public OsCryptoRandom(final Properties props) {
 
         try {
             close();
-            this.stream = new FileInputStream(randomDevFile);
+            this.stream = 
Files.newInputStream(Paths.get(randomDevFile.getPath()));

Review comment:
       I'm not 100% sure about this change.

##########
File path: src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
##########
@@ -30,7 +32,7 @@
  */
 public final class ReflectionUtils {
 
-    private static final Map<ClassLoader, Map<String, 
WeakReference<Class<?>>>> CACHE_CLASSES = new WeakHashMap<>();
+    private static final ConcurrentMap<ClassLoader, Map<String, 
WeakReference<Class<?>>>> CACHE_CLASSES = new ConcurrentHashMap<>();

Review comment:
       HI @garydgregory 
   In order to solve the PMD warning --> 
https://pmd.github.io/latest/pmd_rules_java_multithreading.html#useconcurrenthashmap

##########
File path: pom.xml
##########
@@ -731,5 +731,18 @@ The following provides more details on the included 
cryptographic software:
       <artifactId>junit-jupiter</artifactId>
       <scope>test</scope>
     </dependency>
+    <!-- benchmark -->
+    <dependency>
+      <groupId>org.openjdk.jmh</groupId>
+      <artifactId>jmh-core</artifactId>
+      <version>${jmh.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.openjdk.jmh</groupId>
+      <artifactId>jmh-generator-annprocess</artifactId>
+      <version>${jmh.version}</version>
+      <scope>test</scope>
+    </dependency>

Review comment:
       It wouldn't let me debug. I always getting error because it was not 
possible find all the package org.openjdk.jmh

##########
File path: src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java
##########
@@ -74,7 +76,7 @@ public OsCryptoRandom(final Properties props) {
 
         try {
             close();
-            this.stream = new FileInputStream(randomDevFile);
+            this.stream = 
Files.newInputStream(Paths.get(randomDevFile.getPath()));

Review comment:
       OK @garydgregory 
   I close the PR and I will review the code
   TY.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to