8309630: Clean up tests that reference deploy modules

Reviewed-by: bchristi
This commit is contained in:
Mandy Chung 2023-06-08 01:00:44 +00:00
parent 90027ff204
commit e8a59843f2
2 changed files with 5 additions and 20 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -50,9 +50,6 @@ import java.util.stream.Stream;
public class CheckAccessClassInPackagePermissions {
private static final String[] deployModules = {
"jdk.javaws", "jdk.plugin", "jdk.plugin.server", "jdk.deploy" };
public static void main(String[] args) throws Exception {
// Get the modules in the boot layer loaded by the boot or platform
@ -91,16 +88,9 @@ public class CheckAccessClassInPackagePermissions {
// Check if each target module has the right permissions to access
// its qualified exports
Policy policy = Policy.getPolicy();
List<String> deployMods = Arrays.asList(deployModules);
for (Map.Entry<String, List<String>> me : map.entrySet()) {
String moduleName = me.getKey();
// skip deploy modules since they are granted permissions in
// deployment policy file
if (deployMods.contains(moduleName)) {
continue;
}
// is this a module loaded by the platform loader?
Optional<Module> module = bootLayer.findModule(moduleName);
if (!module.isPresent()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -195,18 +195,13 @@ public class VerifyJimage {
.replaceAll("\\.class$", "").replace('/', '.');
}
private static Set<String> EXCLUDED_MODULES =
Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws",
// All JVMCI packages other than jdk.vm.ci.services are dynamically
// exported to jdk.internal.vm.compiler
"jdk.internal.vm.compiler"
);
// All JVMCI packages other than jdk.vm.ci.services are dynamically
// exported to jdk.internal.vm.compiler
private static Set<String> EXCLUDED_MODULES = Set.of("jdk.internal.vm.compiler");
private boolean accept(String entry) {
int index = entry.indexOf('/', 1);
String mn = index > 1 ? entry.substring(1, index) : "";
// filter deployment modules
if (mn.isEmpty() || EXCLUDED_MODULES.contains(mn)) {
return false;
}