为什么在其 class 初始化之前执行的断言语句表现得好像在 class 中启用了断言?

Why does an assert statement that executes before its class is initialized behave as if assertions were enabled in the class?

http://docs.oracle.com/javase/8/docs/technotes/guides/language/assert.html 列出的最后一个问题是:

Why does an assert statement that executes before its class is initialized behave as if assertions were enabled in the class?

Few programmers are aware of the fact that a class's constructors and methods can run prior to its initialization. When this happens, it is quite likely that the class's invariants have not yet been established, which can cause serious and subtle bugs. Any assertion that executes in this state is likely to fail, alerting the programmer to the problem. Thus, it is generally helpful to the programmer to execute all assertions encountered while in this state.

然而,当我运行:

public class Main {

    static {
        boolean assertionsEnabled = false;
        assert (assertionsEnabled = true);
        System.out.println("static initializer: " + assertionsEnabled);
    }

    public Main() {
        boolean assertionsEnabled = false;
        assert (assertionsEnabled = true);
        System.out.println("constructor: " + assertionsEnabled);
    }

    public static void main(String[] args) {
        new Main();
    }
}

禁用断言后,我得到以下输出:

static initializer: false
constructor: false

Oracle 在上面的文字中指的是什么?何时意外启用断言?

UPDATE:我不是在问为什么我在禁用断言的情况下得到 false 的值。这是意料之中的。我在问为什么 Oracle 暗示断言有时会表现得好像它们已启用,尽管我没有 运行 和 -ea

只需打开Java Language Specification

引用:

public class Foo {
    public static void main(String[] args) {
        Baz.testAsserts();
        // Will execute after Baz is initialized.
    }
}
class Bar {
    static {
        Baz.testAsserts();
        // Will execute before Baz is initialized!
    }
}
class Baz extends Bar {
    static void testAsserts() {
        boolean enabled = false;
        assert  enabled = true;
        System.out.println("Asserts " +
                (enabled ? "enabled" : "disabled"));
    }
}

输出:

Asserts enabled
Asserts disabled