java代码中含有同步和异常,反编译后会出现问题!
原程序:
public int sendRep(){
int i = 0;
synchronized(conn){
try{
conn.bout.write(headbytes);
conn.bout.write(bodybytes);
conn.bout.flush();
}
catch(IOException e){
System.out.println(e.toString());
i = -5;
return i;
}
catch(NullPointerException npe){
i = -5;
return -5
}
}
return i;
}
反编译后:
public int sendRep(){
int i = 0;
cmppSocket cmppsocket = conn;
JVM INSTR monitorenter;
conn.bout.write(headbytes);
conn.bout.write(bodybytes);
conn.bout.flush();
goto _L1
IOException exception;
exception;
System.out.println(e.toStrling());
i = -5;
return i;
NullPointerException npe;
npe;
i = -5;
-5;
cmppsocket;
JVM INSTR monitorexit;
return;
_L1:
cmppsocket;
JVM INSTR monitorexit;
goto _L2
Exception exception;
exception;
cmppsocket;
JVM INSTR monitorexit;
throw exception;
_L2:
return i
}
原程序:
public int sendRep(){
int i = 0;
synchronized(conn){
try{
conn.bout.write(headbytes);
conn.bout.write(bodybytes);
conn.bout.flush();
}
catch(IOException e){
System.out.println(e.toString());
i = -5;
return i;
}
catch(NullPointerException npe){
i = -5;
return -5
}
}
return i;
}
反编译后:
public int sendRep(){
int i = 0;
cmppSocket cmppsocket = conn;
JVM INSTR monitorenter;
conn.bout.write(headbytes);
conn.bout.write(bodybytes);
conn.bout.flush();
goto _L1
IOException exception;
exception;
System.out.println(e.toStrling());
i = -5;
return i;
NullPointerException npe;
npe;
i = -5;
-5;
cmppsocket;
JVM INSTR monitorexit;
return;
_L1:
cmppsocket;
JVM INSTR monitorexit;
goto _L2
Exception exception;
exception;
cmppsocket;
JVM INSTR monitorexit;
throw exception;
_L2:
return i
}