Browse Source

REPORT-76403【迭代】更新日志-更新内容为空,报错Unparseable date: "null"

1、兼容下本地缓存更新日志的逻辑
feature/x
Link.Zhao 2 years ago
parent
commit
a7f3e71910
  1. 9
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

9
designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

@ -87,7 +87,6 @@ public class UpdateMainDialog extends UIDialog {
private static final String HYPHEN = "-";
private final SimpleDateFormat CHANGELOG_FORMAT = new SimpleDateFormat("M/d/y, h:m:s a", Locale.ENGLISH);
private final SimpleDateFormat UPDATELOG_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
private final SimpleDateFormat UPDATE_INFO_TABLE_FORMAT = new SimpleDateFormat("yyyy.MM.dd");
@ -432,7 +431,7 @@ public class UpdateMainDialog extends UIDialog {
}
return array;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage());
FineLoggerFactory.getLogger().error(e,e.getMessage());
}
return JSONArray.create();
}
@ -449,7 +448,7 @@ public class UpdateMainDialog extends UIDialog {
updateCachedInfoFile(jsonArray);
} catch (Exception e) {
getUpdateInfoSuccess = true;
FineLoggerFactory.getLogger().error(e.getMessage());
FineLoggerFactory.getLogger().error(e,e.getMessage());
}
}
};
@ -478,7 +477,7 @@ public class UpdateMainDialog extends UIDialog {
String[] updateInfo = readStr.split("\\t");
if (updateInfo.length == 2) {
updateTimeStr = updateInfo[0];
Date updateTime = CHANGELOG_FORMAT.parse(updateTimeStr);
Date updateTime = UPDATELOG_FORMAT.parse(updateTimeStr);
//形如 Build#release-2018.07.31.03.03.52.80
String currentNO = GeneralUtils.readBuildNO();
Date curJarDate = UPDATE_INFO_TABLE_FORMAT.parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1));
@ -520,7 +519,7 @@ public class UpdateMainDialog extends UIDialog {
try (BufferedWriter bufferWriter = new BufferedWriter(writerStream)) {
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jo = (JSONObject) jsonArray.get(i);
bufferWriter.write((String) jo.get("update") + '\t' + jo.get("title"));
bufferWriter.write((String) jo.get("updateTime") + '\t' + jo.get("jiraId") + " " + jo.get("info"));
bufferWriter.newLine();
bufferWriter.flush();
}

Loading…
Cancel
Save