< prev index next >

test/runtime/modules/JVMAddModuleExports.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.
*** 42,55 **** MyClassLoader to_cl = new MyClassLoader(); Module from_module, to_module; from_module = ModuleHelper.ModuleObject("from_module", from_cl, new String[] { "mypackage", "this/package" }); assertNotNull(from_module, "Module should not be null"); ! ModuleHelper.DefineModule(from_module, "9.0", "from_module/here", new String[] { "mypackage", "this/package" }); to_module = ModuleHelper.ModuleObject("to_module", to_cl, new String[] { "yourpackage", "that/package" }); assertNotNull(to_module, "Module should not be null"); ! ModuleHelper.DefineModule(to_module, "9.0", "to_module/here", new String[] { "yourpackage", "that/package" }); // Null from_module argument, expect an NPE try { ModuleHelper.AddModuleExports((Module)null, "mypackage", to_module); throw new RuntimeException("Failed to get the expected NPE for null from_module"); --- 42,55 ---- MyClassLoader to_cl = new MyClassLoader(); Module from_module, to_module; from_module = ModuleHelper.ModuleObject("from_module", from_cl, new String[] { "mypackage", "this/package" }); assertNotNull(from_module, "Module should not be null"); ! ModuleHelper.DefineModule(from_module, false, "9.0", "from_module/here", new String[] { "mypackage", "this/package" }); to_module = ModuleHelper.ModuleObject("to_module", to_cl, new String[] { "yourpackage", "that/package" }); assertNotNull(to_module, "Module should not be null"); ! ModuleHelper.DefineModule(to_module, false, "9.0", "to_module/here", new String[] { "yourpackage", "that/package" }); // Null from_module argument, expect an NPE try { ModuleHelper.AddModuleExports((Module)null, "mypackage", to_module); throw new RuntimeException("Failed to get the expected NPE for null from_module");
< prev index next >