您的位置:首页 > 编程语言 > Java开发

jad反编译class类文件的时候容易出错的几种情况

2016-06-16 12:44 585 查看
断言:

assert false;

反编译成了

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

assert false : "Element with fixed may not be EMPTY or ELEMENT_ONLY";

反编译成了:

if (!$assertionsDisabled) throw new AssertionError("Element with fixed may not be EMPTY or ELEMENT_ONLY");

局部变量重复声明

局部变量声明错位

int i;

for (i = 0; i < types.length; i++) {}

被反编译成:

for (int i = 0; i < types.length; i++) {}

导致后面用到i的地方报错。

switch语句的case选项中变量名重复

多余错误的构造方法。

private SaajData(){}

反编译后多了个

SaajData(DomImpl.1 x0){

this();

}

声明对象的时候多余null参数:

SaajData a = new SaajData();

反编译成了:

SaajData a = new SaajData(null);

构造中的super遗漏参数:

public SaajCdataNode(Locale l){

super(l);

}

反编译成了:

public SaajCdataNode(Locale l){

super();

}

赋值并判断语句等号出问题

if ((parts[0] = getURI(prefix)) == null)

被反编译成:

if ((parts[0] == getURI(prefix)) == null)

内部类对外部类的引用出问题

class A{

class B{

protect methodB() {

A.this.methodA();

}

}

protect methodA() {}

}

classB被反编译成

class B{

private final A this$0;

protected methodB{

this$0.methodA();

}

}

导致报错。

return语句被拆分报错

return "UCS-4";

被反编译成:

str = "UCS-4";

return str;

报错str未声明。

或者

return null;

被反编译成:

Object obj = null;

return obj;

而需要返回的是String,导致类型不匹配。

xxx.class解析错误

ListDocument.class.getClassLoader()反编译成:

(1.class$org$apache$xmlbeans$impl$xb$xsdschema$ListDocument == null ? (1.class$org$apache$xmlbeans$impl$xb$xsdschema$ListDocument = 1.class$(\"org.apache.xmlbeans.impl.xb.xsdschema.ListDocument\")) : 1.class$org$apache$xmlbeans$impl$xb$xsdschema$ListDocument).getClassLoader()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jad java 反编译