< prev index next >

test/hotspot/jtreg/runtime/HiddenClasses/HiddenGetModule.java

Print this page
rev 58565 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: duke
Contributed-by: mandy.chung@oracle.com, lois.foltan@oracle.com, david.holmes@oracle.com, harold.seigel@oracle.com, serguei.spitsyn@oracle.com, alex.buckley@oracle.com, jamsheed.c.m@oracle.com
rev 58568 : [mq]: hidden-class-4


   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 
  24 /*
  25  * @test
  26  * @summary Test that a hidden class has the same module as its lookup class.
  27  * @library /test/lib
  28  * @modules java.compiler
  29  *          java.management
  30  * @compile pkg/HasNamedModule.java
  31  * @run main/othervm HiddenGetModule
  32  */
  33 
  34 import java.io.ByteArrayOutputStream;
  35 import java.io.File;
  36 import java.io.FileInputStream;
  37 import java.lang.invoke.MethodType;
  38 import java.lang.invoke.MethodHandles;
  39 import java.lang.invoke.MethodHandles.Lookup;
  40 import static java.lang.invoke.MethodHandles.Lookup.ClassOption.*;
  41 import java.io.IOException;
  42 import java.lang.ModuleLayer;
  43 import java.lang.module.Configuration;
  44 import java.lang.module.ModuleDescriptor;
  45 import java.lang.module.ModuleFinder;
  46 import java.lang.module.ModuleReader;
  47 import java.lang.module.ModuleReference;
  48 import java.lang.reflect.Method;
  49 import java.net.URI;




   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 
  24 /*
  25  * @test
  26  * @summary Test that a hidden class has the same module as its lookup class.
  27  * @library /test/lib
  28  * @modules jdk.compiler

  29  * @compile pkg/HasNamedModule.java
  30  * @run main/othervm HiddenGetModule
  31  */
  32 
  33 import java.io.ByteArrayOutputStream;
  34 import java.io.File;
  35 import java.io.FileInputStream;
  36 import java.lang.invoke.MethodType;
  37 import java.lang.invoke.MethodHandles;
  38 import java.lang.invoke.MethodHandles.Lookup;
  39 import static java.lang.invoke.MethodHandles.Lookup.ClassOption.*;
  40 import java.io.IOException;
  41 import java.lang.ModuleLayer;
  42 import java.lang.module.Configuration;
  43 import java.lang.module.ModuleDescriptor;
  44 import java.lang.module.ModuleFinder;
  45 import java.lang.module.ModuleReader;
  46 import java.lang.module.ModuleReference;
  47 import java.lang.reflect.Method;
  48 import java.net.URI;


< prev index next >