< prev index next >
test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2000, 2012, 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) 2000, 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.
*** 47,57 ****
}
public static void main(String[] args) {
try {
System.err.println("\nRegression test for bug 4331349\n");
! Registry registry = TestLibrary.createRegistryOnUnusedPort();
int registryPort = TestLibrary.getRegistryPort(registry);
Remote obj = new UnexportLeak();
WeakReference wr = new WeakReference(obj);
UnicastRemoteObject.exportObject(obj);
LocateRegistry.getRegistry(registryPort).rebind("UnexportLeak", obj);
--- 47,57 ----
}
public static void main(String[] args) {
try {
System.err.println("\nRegression test for bug 4331349\n");
! Registry registry = TestLibrary.createRegistryOnEphemeralPort();
int registryPort = TestLibrary.getRegistryPort(registry);
Remote obj = new UnexportLeak();
WeakReference wr = new WeakReference(obj);
UnicastRemoteObject.exportObject(obj);
LocateRegistry.getRegistry(registryPort).rebind("UnexportLeak", obj);
< prev index next >