-
Bug
-
Resolution: Fixed
-
P3
-
9-repo-jigsaw
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085069 | emb-9 | Alan Bateman | P3 | Resolved | Fixed | team |
This test has a dependency on rt.jar and fails with a modular image build. The test has already been fixed in jigsaw/m2, we should get the fix in jdk9/dev.
diff -r 658cf686f80b -r 5046e8e49c49 test/javax/management/MBeanInfo/NotificationInfoTest.java
--- a/test/javax/management/MBeanInfo/NotificationInfoTest.java Fri Sep 19 12:07:21 2014 +0100
+++ b/test/javax/management/MBeanInfo/NotificationInfoTest.java Fri Sep 19 12:42:36 2014 +0100
@@ -36,7 +36,6 @@
import java.lang.management.*;
import java.lang.reflect.*;
import java.net.*;
-import java.security.CodeSource;
import java.util.*;
import java.util.jar.*;
import javax.management.*;
@@ -83,27 +82,10 @@
System.out.println("Checking platform MBeans...");
checkPlatformMBeans();
- CodeSource cs =
- javax.management.MBeanServer.class.getProtectionDomain()
- .getCodeSource();
- URL codeBase;
- if (cs == null) {
- String javaHome = System.getProperty("java.home");
- String[] candidates = {"/lib/rt.jar", "/classes/"};
- codeBase = null;
- for (String candidate : candidates) {
- File file = new File(javaHome + candidate);
- if (file.exists()) {
- codeBase = file.toURI().toURL();
- break;
- }
- }
- if (codeBase == null) {
- throw new Exception(
- "Could not determine codeBase for java.home=" + javaHome);
- }
- } else
- codeBase = cs.getLocation();
+ URL codeBase = ClassLoader.getSystemResource("javax/management/MBeanServer.class");
+ if (codeBase == null) {
+ throw new Exception("Could not determine codeBase for " + MBeanServer.class);
+ }
System.out.println();
System.out.println("Looking for standard MBeans...");
- backported by
-
JDK-8085069 javax/management/MBeanInfo/NotificationInfoTest.java fails with modular image
-
- Resolved
-