java反编译 第二部分、异常

第二部分、异常

   下面的代码前提是类中有如下属性, Calendar cal = Calendar.getInstance();。

    1、Exceptioin的还原    反编译后的代码如下:

view plaincopy to clipboardprint?
public boolean f1()

{

    return cal.getTime().after(new Date());

    Exception e;

    e;

    e.printStackTrace();

    return false;

}
还原后的Java代码
view plaincopy to clipboardprint?
public boolean f1()

{

    try

    {

        return cal.getTime().after(new Date());

    }

    catch (Exception e)

    {

        e.printStackTrace();

        return false;

    }

}
2、finally代码的还原 反编译后的Java代码如下:
view plaincopy to clipboardprint?
public boolean f2()

{

    boolean flag = cal.getTime().after(new Date());

    System.out.println("finally");

    return flag;

    Exception e;

    e;

    e.printStackTrace();

    System.out.println("finally");

    return false;  
    Exception exception;  
    exception;  
    System.out.println("finally");  
    throw exception;  
}
还原后的代码如下:
view plaincopy to clipboardprint?
public boolean f2()

{  
    try  
    {  
        return cal.getTime().after(new Date());  
    }  
    catch (Exception e)  
    {  
        e.printStackTrace();  
        return false;  
    }  
    finally  
    {  
        System.out.println("finally");  
    }  
}
3、 MISSING_BLOCK_LABEL_的还原反编译后的代码
view plaincopy to clipboardprint?
public Object f22()  
{  
    Date date = cal.getTime();  
    System.out.println("finally");  
    return date;  
    Exception e;  
    e;  
    e.printStackTrace();  
    System.out.println("finally");  
    break MISSING_BLOCK_LABEL_45;  
    Exception exception;  
    exception;  
    System.out.println("finally");