Is intent to *check* or *set* assertions?

Joel Buckley mail2leoj at gmail.com
Mon Dec 25 01:25:10 UTC 2017


Hi Graal-dev,

In Substrate-Util.java[1], is the intent to *check* and/or *set* assertions to *true*?


    /**
     * Checks whether assertions are enabled in the VM.
     *
     * @return true if assertions are enabled.
     */
    @SuppressWarnings("all")
    public static boolean assertionsEnabled() {
        boolean assertionsEnabled = false;
        assert assertionsEnabled = true; // should this be “== true”?
        return assertionsEnabled; // Otherwise, this is always true...
    }


Thanks,
Joel.

[1]https://github.com/graalvm/graal/blob/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateUtil.java <https://github.com/graalvm/graal/blob/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateUtil.java>



More information about the graal-dev mailing list