< prev index next >
test/runtime/modules/JVMAddReadsModule.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2016, 2017, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 41,55 ****
MyClassLoader to_cl = new MyClassLoader();
Object from_module, to_module;
from_module = ModuleHelper.ModuleObject("from_module", from_cl, new String[] { "mypackage" });
assertNotNull(from_module, "Module should not be null");
! ModuleHelper.DefineModule(from_module, "9.0", "from_module/here", new String[] { "mypackage" });
to_module = ModuleHelper.ModuleObject("to_module", to_cl, new String[] { "yourpackage" });
assertNotNull(to_module, "Module should not be null");
! ModuleHelper.DefineModule(to_module, "9.0", "to_module/here", new String[] { "yourpackage" });
// Null from_module argument, expect NPE
try {
ModuleHelper.AddReadsModule(null, to_module);
throw new RuntimeException("Failed to get the expected NPE");
--- 41,55 ----
MyClassLoader to_cl = new MyClassLoader();
Object from_module, to_module;
from_module = ModuleHelper.ModuleObject("from_module", from_cl, new String[] { "mypackage" });
assertNotNull(from_module, "Module should not be null");
! ModuleHelper.DefineModule(from_module, false, "9.0", "from_module/here", new String[] { "mypackage" });
to_module = ModuleHelper.ModuleObject("to_module", to_cl, new String[] { "yourpackage" });
assertNotNull(to_module, "Module should not be null");
! ModuleHelper.DefineModule(to_module, false, "9.0", "to_module/here", new String[] { "yourpackage" });
// Null from_module argument, expect NPE
try {
ModuleHelper.AddReadsModule(null, to_module);
throw new RuntimeException("Failed to get the expected NPE");
< prev index next >