我下了小颖Java源代码反编译专家V1.4,反编译的代码和源代码都放在下面,的确有try{}exception{}问题:
反编译的代码:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: DateTime.java
package com.xxxx.tool;
import java.io.PrintStream;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class DateTime
{
public DateTime()
{
}
private static String[] ParseDate(Date dDate)
{
String aResult[];
aResult = new String[7];
Calendar ca = Calendar.getInstance();
ca.setTime(dDate);
aResult[0] = ca.toString(ca.get(1));
aResult[1] = ca.toString(ca.get(2) + 1);
aResult[2] = ca.toString(ca.get(5));
aResult[3] = ca.toString(ca.get(11));
aResult[4] = ca.toString(ca.get(12));
aResult[5] = ca.toString(ca.get(13));
aResult[6] = ca.toString(ca.get(1));
if(aResult[1].length() == 1)
aResult[1] = "0"
+ aResult[1];
if(aResult[2].length() == 1)
aResult[2] = "0"
+ aResult[2];
if(aResult[3].length() == 1)
aResult[3] = "0"
+ aResult[3];
if(aResult[4].length() == 1)
aResult[4] = "0"
+ aResult[4];
if(aResult[5].length() == 1)
aResult[5] = "0"
+ aResult[5];
return aResult;
Exception ex;
ex;
return null;
}
}
源代码:
package com.xxxx.tool;
import java.util.*;
public class DateTime {
public DateTime() {
}
private static String[] ParseDate(Date dDate) {
try {
String[] aResult = new String[7];
java.util.Calendar ca = java.util.Calendar.getInstance();
ca.setTime(dDate);
aResult[0] = Integer.toString(ca.get(ca.YEAR));
aResult[1] = Integer.toString(ca.get(ca.MONTH) + 1);
aResult[2] = Integer.toString(ca.get(ca.DATE));
aResult[3] = Integer.toString(ca.get(ca.HOUR_OF_DAY));
aResult[4] = Integer.toString(ca.get(ca.MINUTE));
aResult[5] = Integer.toString(ca.get(ca.SECOND));
aResult[6] = Integer.toString(ca.get(ca.YEAR));
if (aResult[1].length() == 1) {
aResult[1] = "0"
+ aResult[1];
}
if (aResult[2].length() == 1) {
aResult[2] = "0"
+ aResult[2];
}
if (aResult[3].length() == 1) {
aResult[3] = "0"
+ aResult[3];
}
if (aResult[4].length() == 1) {
aResult[4] = "0"
+ aResult[4];
}
if (aResult[5].length() == 1) {
aResult[5] = "0"
+ aResult[5];
}
return aResult;
}
catch (Exception ex) {
return null;
}
}
}