Merge remote-tracking branch 'remotes/origin/master' into hechu1

# Conflicts:
#	src/gdms/GDMS.java
hechu1
何楚 6 years ago
commit d580b21f4c

@ -2,17 +2,19 @@ package gdms;
import dao.DBManagement; import dao.DBManagement;
import error.GExcptFileIO; import error.GExcptFileIO;
import error.GExcptFormat;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL; import error.GExcptSQL;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import utils.Utils; import utils.Utils;
import java.text.ParseException;
import java.util.*; import java.util.*;
public class GDMS { public class GDMS {
static Map<String, Date> schedules; static Map<String, Date> schedules;
static String schedulePath = ""; static String schedulePath = "";
public static void init() throws GExcptInit { public static void init() throws GExcptInit, GExcptFormat {
initSchedule(); initSchedule();
Timer timer = new Timer(true); Timer timer = new Timer(true);
for(Map.Entry<String, Date> schedule:schedules.entrySet()){ for(Map.Entry<String, Date> schedule:schedules.entrySet()){
@ -204,7 +206,7 @@ public class GDMS {
throw new GExcptInit("GlobalTimePoint.json error"); throw new GExcptInit("GlobalTimePoint.json error");
} }
private static void initSchedule() { private static void initSchedule() throws GExcptFormat {
schedules = new HashMap<>(); schedules = new HashMap<>();
String sets= null; String sets= null;
try { try {
@ -217,7 +219,12 @@ public class GDMS {
while (it.hasNext()) { while (it.hasNext()) {
String key = (String)it.next(); String key = (String)it.next();
Object value = jo.get(key); Object value = jo.get(key);
//schedules.put(key, new utils.Utils.dateFormat((String) value)); try {
schedules.put(key, Configuration.dateFormat.parse((String) value));
} catch (ParseException e) {
e.printStackTrace();
throw new GExcptFormat("json date format error");
}
} }
} }
} }

Loading…
Cancel
Save