Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8301737: java/rmi/server/UnicastRemoteObject/serialFilter/FilterUROTest.java fail with -Xcomp #12399

Closed
wants to merge 6 commits into from
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@
import java.rmi.server.UnicastRemoteObject;

import java.util.Objects;
import java.lang.ref.Reference;

import org.testng.Assert;
import org.testng.annotations.DataProvider;
@@ -43,7 +44,6 @@
*/
public class FilterUROTest {

private static RemoteImpl impl;
/**
* Data to test serialFilter call counts.
* - name
@@ -71,12 +71,13 @@ static Object[][] bindObjects() {
@Test(dataProvider = "bindData")
public void useExportObject(String name, Object obj, int expectedFilterCount) throws RemoteException {
try {
impl = RemoteImpl.create();
RemoteImpl impl = RemoteImpl.create();
Echo client = (Echo) UnicastRemoteObject
.exportObject(impl, 0, impl.checker);
int count = client.filterCount(obj);
System.out.printf("count: %d, obj: %s%n", count, obj);
Assert.assertEquals(count, expectedFilterCount, "wrong number of filter calls");
Reference.reachabilityFence(impl);
} catch (RemoteException rex) {
if (expectedFilterCount == -1 &&
UnmarshalException.class.equals(rex.getCause().getClass()) &&
@@ -98,12 +99,13 @@ public void useExportObject(String name, Object obj, int expectedFilterCount) th
@Test(dataProvider = "bindData")
public void useExportObject2(String name, Object obj, int expectedFilterCount) throws RemoteException {
try {
impl = RemoteImpl.create();
RemoteImpl impl = RemoteImpl.create();
Echo client = (Echo) UnicastRemoteObject
.exportObject(impl, 0, null, null, impl.checker);
int count = client.filterCount(obj);
System.out.printf("count: %d, obj: %s%n", count, obj);
Assert.assertEquals(count, expectedFilterCount, "wrong number of filter calls");
Reference.reachabilityFence(impl);
} catch (RemoteException rex) {
if (expectedFilterCount == -1 &&
UnmarshalException.class.equals(rex.getCause().getClass()) &&