gpt4 book ai didi

java - 其他人知道这是什么意思吗?

转载 作者:搜寻专家 更新时间:2023-11-01 04:04:47 24 4
gpt4 key购买 nike

static final boolean $assertionsDisabled = !java/util/TaskQueue.desiredAssertionStatus();

在源文件java.util.TaskQueue.java中看到

最佳答案

引用 6.2.1 Assertion Overhead :

It is useful to understand how the assertion mechanism works to see how assertion statements can affect performance. When the compiler finds an assertion in a class, it adds a generated static final field named $assertionsDisabled to the class. The field is left unassigned (this is legal bytecode). The assertion itself is compiled into a statement of the form:

if ($assertionsDisabled)
if (!boolean_expression)
throw new AssertionError(String_expression);

关于java - 其他人知道这是什么意思吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10716970/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com