8214696: Module class should be filtered by core reflection
Reviewed-by: lancea, mchung, sundar
--- a/src/java.base/share/classes/jdk/internal/reflect/Reflection.java Thu Dec 13 13:03:26 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/reflect/Reflection.java Thu Dec 13 09:02:52 2018 +0000
@@ -56,6 +56,7 @@
Constructor.class, ALL_MEMBERS,
Field.class, ALL_MEMBERS,
Method.class, ALL_MEMBERS,
+ Module.class, ALL_MEMBERS,
System.class, Set.of("security")
);
methodFilterMap = Map.of();
--- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java Thu Dec 13 13:03:26 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java Thu Dec 13 09:02:52 2018 +0000
@@ -772,7 +772,8 @@
f.getDeclaringClass().equals(metaAccess.lookupJavaType(AccessibleObject.class)) ||
f.getDeclaringClass().equals(metaAccess.lookupJavaType(Constructor.class)) ||
f.getDeclaringClass().equals(metaAccess.lookupJavaType(Field.class)) ||
- f.getDeclaringClass().equals(metaAccess.lookupJavaType(Method.class))) {
+ f.getDeclaringClass().equals(metaAccess.lookupJavaType(Method.class)) ||
+ f.getDeclaringClass().equals(metaAccess.lookupJavaType(Module.class))) {
return true;
}
return false;
--- a/test/jdk/jdk/internal/reflect/Reflection/Filtering.java Thu Dec 13 13:03:26 2018 +0530
+++ b/test/jdk/jdk/internal/reflect/Reflection/Filtering.java Thu Dec 13 09:02:52 2018 +0000
@@ -61,6 +61,8 @@
{ Lookup.class, "allowedModes" },
{ Method.class, "clazz" },
{ Method.class, "modifiers" },
+ { Module.class, "name" },
+ { Module.class, "loader" },
{ System.class, "security" },
};
}