test/jdk/java/io/Serializable/resolveClass/deserializeButton/DeserializeButtonTest.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
44 public static void main(String[] args) throws Exception { |
44 public static void main(String[] args) throws Exception { |
45 setup(); |
45 setup(); |
46 |
46 |
47 try (URLClassLoader ldr = |
47 try (URLClassLoader ldr = |
48 new URLClassLoader(new URL[]{ new URL("file:cb.jar") })) { |
48 new URLClassLoader(new URL[]{ new URL("file:cb.jar") })) { |
49 Runnable r = (Runnable) Class.forName("Foo", true, ldr).newInstance(); |
49 Runnable r = (Runnable) Class.forName("Foo", true, ldr) |
|
50 .getConstructor().newInstance(); |
50 r.run(); |
51 r.run(); |
51 } |
52 } |
52 } |
53 } |
53 |
54 |
54 private static void setup() throws Exception { |
55 private static void setup() throws Exception { |