java反编译输出中的标签位置

发布于 2024-08-19 18:52:13 字数 577 浏览 3 评论 0原文

我正在使用 jd-gui 反编译一个类文件,我得到了一个中断标签(label1076),如下所示。 在 Eclipse 中,我编译时出错,因为标签是在使用后声明的。 不使用break语句的等效java代码是什么?

public List buildChildList()
{
for (int i = 0; i < size; ++i)
{

... for (int i = 0; i < relatedWorkExpressions.size(); ++i) {

     ...
     try
     {
      ...           
     }
     catch (Exception ex)
     {

... 打破标签1076: }

     ...
     ...
     ...
     label1076: childList[childPosition.intValue()] = child;
   }

}

... }

I am using jd-gui to decompile a class file, and I got a break label (label1076) as below.
In eclipse I got an error compiling because the label is declared after it is used.
What is the equivalent java code without using break statement?

public List buildChildList()
{
for (int i = 0; i < size; ++i)
{

...
for (int i = 0; i < relatedWorkExpressions.size(); ++i) {

     ...
     try
     {
      ...           
     }
     catch (Exception ex)
     {

...
break label1076:
}

     ...
     ...
     ...
     label1076: childList[childPosition.intValue()] = child;
   }

}

...
}

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

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

发布评论

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

评论(1

此生挚爱伱 2024-08-26 18:52:13

等效的未标记 Java 将取决于代码逻辑。给定两个嵌套循环,标签可能应该位于外循环之前。跳出内部循环不需要标签,如图所示 这里

The equivalent unlabeled Java would depend on the logic of code. Given two nested loops, the label probably should precede the outer loop. Breaking out of the inner loop wouldn't require a label, as shown here.

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