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()
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()
相关文章推荐
- java对世界各个时区(TimeZone)的通用转换处理方法(转载)
- java-注解annotation
- java-模拟tomcat服务器
- java-用HttpURLConnection发送Http请求.
- java-WEB中的监听器Lisener
- Android IPC进程间通讯机制
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 介绍一款信息管理系统的开源框架---jeecg
- 聚类算法之kmeans算法java版本
- java实现 PageRank算法
- PropertyChangeListener简单理解
- c++11 + SDL2 + ffmpeg +OpenAL + java = Android播放器
- 插入排序
- 冒泡排序
- 堆排序
- 快速排序
- 二叉查找树