changeset 13361:c1d6cbb4a84e

Fix Graal/JVMCI to call Module::getPackages with right signature
author mchung
date Wed, 29 Mar 2017 13:09:51 -0700
parents 1cfb867aa558
children 6f3a68d98adb
files src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java	Tue Mar 28 13:28:24 2017 +0100
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java	Wed Mar 29 13:09:51 2017 -0700
@@ -28,6 +28,7 @@
 import java.util.Iterator;
 import java.util.ServiceConfigurationError;
 import java.util.ServiceLoader;
+import java.util.Set;
 
 /**
  * A mechanism for accessing service providers via JVMCI.
@@ -108,7 +109,7 @@
             Object jvmci = invoke(getModule, Services.class);
             Object requestorModule = invoke(getModule, requestor);
             if (jvmci != requestorModule) {
-                String[] packages = invoke(getPackages, jvmci);
+                Set<String> packages = invoke(getPackages, jvmci);
                 for (String pkg : packages) {
                     // Export all JVMCI packages dynamically instead
                     // of requiring a long list of --add-exports
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java	Tue Mar 28 13:28:24 2017 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java	Wed Mar 29 13:09:51 2017 -0700
@@ -23,6 +23,7 @@
 package org.graalvm.compiler.test;
 
 import java.lang.reflect.Method;
+import java.util.Set;
 
 /**
  * Facade for the {@code java.lang.Module} class introduced in JDK9 that allows tests to be
@@ -95,9 +96,9 @@
         }
     }
 
-    public String[] getPackages() {
+    public Set<String> getPackages() {
         try {
-            return (String[]) getPackagesMethod.invoke(realModule);
+            return (Set<String>) getPackagesMethod.invoke(realModule);
         } catch (Exception e) {
             throw new AssertionError(e);
         }