Skip to content

Commit

Permalink
8309630: Clean up tests that reference deploy modules
Browse files Browse the repository at this point in the history
Reviewed-by: bchristi
  • Loading branch information
Mandy Chung committed Jun 8, 2023
1 parent 90027ff commit e8a5984
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -50,9 +50,6 @@

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
Expand Down Expand Up @@ -91,16 +88,9 @@ public static void main(String[] args) throws Exception {
// 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()) {
Expand Down
13 changes: 4 additions & 9 deletions test/jdk/tools/jimage/VerifyJimage.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -195,18 +195,13 @@ private String toClassName(String entry) {
.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;
}
Expand Down

3 comments on commit e8a5984

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on e8a5984 Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on e8a5984 Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-e8a59843 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit e8a59843 from the openjdk/jdk repository.

The commit being backported was authored by Mandy Chung on 8 Jun 2023 and was reviewed by Brent Christian.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-e8a59843:backport-GoeLin-e8a59843
$ git checkout backport-GoeLin-e8a59843
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-e8a59843

Please sign in to comment.