commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1751176 - /commons/proper/bcel/trunk/src/test/java/org/apache/bcel/generic/JDKGenericDumpTestCase.java
Date Sun, 03 Jul 2016 22:54:23 GMT
Author: ggregory
Date: Sun Jul  3 22:54:23 2016
New Revision: 1751176

URL: http://svn.apache.org/viewvc?rev=1751176&view=rev
Log:
Fix test that breaks in a RC reviewer's Windows 10 set up. 

Modified:
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/generic/JDKGenericDumpTestCase.java

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/generic/JDKGenericDumpTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/generic/JDKGenericDumpTestCase.java?rev=1751176&r1=1751175&r2=1751176&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/generic/JDKGenericDumpTestCase.java
(original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/generic/JDKGenericDumpTestCase.java
Sun Jul  3 22:54:23 2016
@@ -45,8 +45,9 @@ import org.junit.runners.Parameterized.P
 import com.sun.jna.platform.win32.Advapi32Util;
 
 /**
- * Test that the generic dump() methods work on the JDK classes Reads each class into an
instruction list and then dumps
- * the instructions. The output bytes should be the same as the input.
+ * Test that the generic dump() methods work on the JDK classes Reads each class
+ * into an instruction list and then dumps the instructions. The output bytes
+ * should be the same as the input.
  */
 @RunWith(Parameterized.class)
 public class JDKGenericDumpTestCase {
@@ -81,11 +82,13 @@ public class JDKGenericDumpTestCase {
     private static Set<String> findJavaHomesOnWindows(final String[] keys) {
         final Set<String> javaHomes = new HashSet<>(keys.length);
         for (final String key : keys) {
-            final String javaHome = Advapi32Util.registryGetStringValue(HKEY_LOCAL_MACHINE,
KEY_JRE + "\\" + key,
-                    "JavaHome");
-            if (StringUtils.isNoneBlank(javaHome)) {
-                if (new File(javaHome).exists()) {
-                    javaHomes.add(javaHome);
+            if (Advapi32Util.registryKeyExists(HKEY_LOCAL_MACHINE, KEY_JRE + "\\" + key))
{
+                final String javaHome = Advapi32Util.registryGetStringValue(HKEY_LOCAL_MACHINE,
KEY_JRE + "\\" + key,
+                        "JavaHome");
+                if (StringUtils.isNoneBlank(javaHome)) {
+                    if (new File(javaHome).exists()) {
+                        javaHomes.add(javaHome);
+                    }
                 }
             }
         }



Mime
View raw message