Skip to content

Commit c7cf482

Browse files
committed
Make use of Module.getPackages() hard error for libgraal
1 parent cde9098 commit c7cf482

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/LibGraalSubstitutions.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
package jdk.graal.compiler.libgraal;
2626

2727
import java.text.DateFormatSymbols;
28-
import java.util.Collections;
2928
import java.util.Locale;
3029
import java.util.Set;
3130

@@ -35,6 +34,7 @@
3534
import com.oracle.svm.core.annotate.TargetClass;
3635

3736
import jdk.graal.compiler.debug.DebugOptions;
37+
import jdk.graal.compiler.debug.GraalError;
3838

3939
class LibGraalSubstitutions {
4040

@@ -124,9 +124,12 @@ static Class<?> findBootstrapClassOrNull(String name) {
124124
*/
125125
@TargetClass(value = java.lang.Module.class, onlyWith = LibGraalFeature.IsEnabled.class)
126126
static final class Target_java_lang_Module {
127+
@Alias
128+
public native String getName();
129+
127130
@Substitute
128131
public Set<String> getPackages() {
129-
return Collections.emptySet();
132+
throw GraalError.unimplemented("Module.getPackages() for module " + getName() + " (class loading not supported in libgraal)");
130133
}
131134
}
132135

0 commit comments

Comments
 (0)