this = 反编译Java中的this

发布于 2024-07-26 16:25:59 字数 286 浏览 1 评论 0原文

我尝试反编译一个没有源代码的 Java 应用程序,结果出现了奇怪的情况。 在类的构造函数的顶部,有一行内容

this = this

this (不是 this)意味着什么? 这只是反编译过程的产物吗? 或者这只是一些丑陋的黑客行为? 这个可以分配给其他东西吗? 如果是这样,

this = null

意味着什么?

I tried decompiling a Java application to which I do not have the source code and a strange thing showed up. At the top of the constructor for a class, there is a line that says

this = this

What does this (not this) mean? Is this just an artifact of the decompilation process? Or is it just some ugly hack? Can this be assigned to something else? If so, what does

this = null

mean?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤蝉 2024-08-02 16:25:59

是最终的。 你绝对不能分配它。 我猜这是一个反汇编器工件。

内部类(其中包含指向外部类的 this 指针)可能存在一些潜在的愚蠢之处,但所编写的这些行不是有效的 Java。

this is final. You definitely cannot assign it. I'd guess this is a disassembler artifact.

There's some potential goofy-ness with inner classes (which hold this pointers to the outer class), but those lines as written are not valid Java.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文