gpt4 book ai didi

java - 为什么类文件不包含足够的信息来提供 NPE 中为空的指针的名称?

转载 作者:搜寻专家 更新时间:2023-10-31 19:56:33 25 4
gpt4 key购买 nike

回应Can Java's NullPointerException be changed to report on which variable was null? thorbjorn-ravn-andersen说:

No, the debug information in the class file does not contain enough information to allow this.

我的问题是,为什么不呢?

最佳答案

它可能根本不是一个变量:它可能是一个临时结果,例如方法调用的结果。当 NPE 发生时,它只是一个匿名堆栈槽。

关于java - 为什么类文件不包含足够的信息来提供 NPE 中为空的指针的名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14129455/

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