RFR: 8284490: Remove finalizer method in java.security.jgss [v3]

Weijun Wang weijun at openjdk.java.net
Fri Apr 8 13:53:41 UTC 2022


On Thu, 7 Apr 2022 19:21:31 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

>> Please review the update to remove finalizer method in the java.security.jgss module. It is one of the efforts to clean up the use of finalizer method in JDK.
>
> Xue-Lei Andrew Fan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update copyright year

@bchristi-git showed me this test. You might try it on other objects:

import org.ietf.jgss.GSSManager;
import org.ietf.jgss.GSSName;

import java.util.WeakHashMap;

public class A1 {
    private static WeakHashMap whm = new WeakHashMap();
    public static void main(String[] args) throws Exception {
        System.setProperty("sun.security.nativegss.debug", "true");
        System.setProperty("sun.security.jgss.native", "true");
        GSSName e = GSSManager.getInstance().createName("u1", GSSName.NT_USER_NAME);
        whm.put(e, null);
        e = null;
        for (int i = 0; i < 10; i++) {
            System.gc();
            Thread.sleep(100);
        }
        if (whm.size() > 0) {
            throw new RuntimeException("GSSElementName still reachable");
        }
    }
}

-------------

PR: https://git.openjdk.java.net/jdk/pull/8136



More information about the security-dev mailing list