test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/ModuleSupport.java
changeset 58523 fb3d408c7a7e
equal deleted inserted replaced
58522:17a34e111667 58523:fb3d408c7a7e
       
     1 /*
       
     2  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.
       
     8  *
       
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    12  * version 2 for more details (a copy is included in the LICENSE file that
       
    13  * accompanied this code).
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License version
       
    16  * 2 along with this work; if not, write to the Free Software Foundation,
       
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    18  *
       
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    20  * or visit www.oracle.com if you need additional information or have any
       
    21  * questions.
       
    22  */
       
    23 package com.oracle.mxtool.junit;
       
    24 
       
    25 import java.io.PrintStream;
       
    26 import java.util.Set;
       
    27 
       
    28 /**
       
    29  * Interface to {@code java.lang.Module} related functionality.
       
    30  */
       
    31 class ModuleSupport {
       
    32 
       
    33     /**
       
    34      * @param out stream to use for printing warnings
       
    35      */
       
    36     ModuleSupport(PrintStream out) {
       
    37     }
       
    38 
       
    39     /**
       
    40      * Exports and opens packages based on {@code spec}. See further documentation in
       
    41      * {@code mx_unittest.py}.
       
    42      *
       
    43      * @param spec
       
    44      * @param context
       
    45      * @param opened the set of opens performed are added to this set in the format
       
    46      *            {@code <module>/<package>=<target-module>(,<target-module>)*} (e.g.
       
    47      *            {@code "com.foo/com.foo.util=ALL-NAMED,com.bar"})
       
    48      * @param exported the set of exports performed are added to this set in the format
       
    49      *            {@code <module>/<package>=<target-module>(,<target-module>)*} (e.g.
       
    50      *            {@code "com.foo/com.foo.util=ALL-NAMED,com.bar"})
       
    51      */
       
    52     void openPackages(String spec, Object context, Set<String> opened, Set<String> exported) {
       
    53         // Nop on JDK 8
       
    54     }
       
    55 
       
    56     /**
       
    57      * Updates modules specified in {@code AddExport} annotations on {@code classes} to export and
       
    58      * open packages to the annotation classes' declaring modules.
       
    59      *
       
    60      * @param classes
       
    61      * @param opened the set of opens performed are added to this set in the format
       
    62      *            {@code <module>/<package>=<target-module>(,<target-module>)*} (e.g.
       
    63      *            {@code "com.foo/com.foo.util=ALL-NAMED,com.bar"})
       
    64      * @param exported the set of exports performed are added to this set in the format
       
    65      *            {@code <module>/<package>=<target-module>(,<target-module>)*} (e.g.
       
    66      *            {@code "com.foo/com.foo.util=ALL-NAMED,com.bar"})
       
    67      */
       
    68     void processAddExportsAnnotations(Set<Class<?>> classes, Set<String> opened, Set<String> exported) {
       
    69         // Nop on JDK 8
       
    70     }
       
    71 }