开发者

Label position in java decompiling output

开发者 https://www.devze.com 2022-12-18 20:59 出处:网络
I am using jd-gui to decompile a class fi开发者_如何学JAVAle, and I got a break label (label1076) as below.

I am using jd-gui to decompile a class fi开发者_如何学JAVAle, 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;
   }

}

... }


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消