Would it not be simpler to use the IODH idiom for the lazy init?

For example:

public class IgnoreSpecProvider implements CookieSpecProvider {

    public IgnoreSpecProvider() {
        super();
    }

    @Override
    public CookieSpec create(final HttpContext context) {
        return IgnoreSpec.getInstance();
    }

}

public class IgnoreSpec extends CookieSpecBase {

    private static class SpecHolder {
        private static final IgnoreSpec INSTANCE = new IgnoreSpec();
    }

    public static IgnoreSpec getInstance() {
        return SpecHolder.INSTANCE;
    }

    private IgnoreSpec() { // prevent external init (not strictly necessary)
        super();
    }

.... rest of class
}

Just a thought.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to