Browse Source

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

Merge in DESIGN/design from ~LINK.ZHAO/design:release/11.0 to release/11.0

* commit '5ec3369478f5c750a8ddebb3f24766749e450d7a':
  REPORT-76403 【迭代】更新日志-更新内容为空,报错Unparseable date: "null" 1、兼容下更新日志的缓存 2、昨天提交到feature的,没合的,提交到release
release/11.0
Link.Zhao 2 years ago
parent
commit
fe4928bbad
  1. 23
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

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

@ -59,7 +59,6 @@ import java.util.*;
import java.util.List;
import java.util.concurrent.ExecutionException;
import static com.fr.design.dialog.FineJOptionPane.OPTION_OK_CANCEL;
import static java.nio.charset.StandardCharsets.*;
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
@ -475,19 +474,22 @@ public class UpdateMainDialog extends UIDialog {
String readStr, updateTimeStr;
while ((readStr = br.readLine()) != null) {
String[] updateInfo = readStr.split("\\t");
if (updateInfo.length == 2) {
updateTimeStr = updateInfo[0];
if (updateInfo.length == 3) {
updateTimeStr = updateInfo[UpdateInfoTable.UPDATE_DATE_INDEX];
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));
if (!ComparatorUtils.equals(keyword, StringUtils.EMPTY)) {
if (!containsKeyword(UPDATE_INFO_TABLE_FORMAT.format(updateTime), keyword) && !containsKeyword(updateInfo[1], keyword)) {
keyword.replace('.','-');
if (!containsKeyword(UPDATELOG_FORMAT.format(updateTime), keyword) && !containsKeyword(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], keyword)) {
continue;
}
}
if (isValidLogInfo(updateInfo[1]) && curJarDate != null) {
updateInfoList.add(new Object[]{UPDATE_INFO_TABLE_FORMAT.format(updateTime), updateInfo[1], updateTime.after(curJarDate)});
if (isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null) {
updateInfoList.add(new Object[]{UPDATELOG_FORMAT.format(updateTime), updateInfo[UpdateInfoTable.UPDATE_VERSION_INDEX], updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], updateTime.after(curJarDate)});
}
}
}
@ -521,7 +523,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("updateTime") + '\t' + jo.get("jiraId") + " " + jo.get("info"));
bufferWriter.write((String) jo.get("updateTime") + '\t' + jo.get("version") + '\t' + jo.get("jiraId") + " " + jo.get("info"));
bufferWriter.newLine();
bufferWriter.flush();
}
@ -546,13 +548,14 @@ public class UpdateMainDialog extends UIDialog {
if (curJarDate == null) {
curJarDate = updateTime;
}
if (!ComparatorUtils.equals(keyword, StringUtils.EMPTY)) {
if (!containsKeyword(UPDATE_INFO_TABLE_FORMAT.format(updateTime), keyword) && !containsKeyword(updateTitle, keyword)) {
if (!ComparatorUtils.equals(keyword, StringUtils.EMPTY) && keyword != null) {
keyword.replace('.', '-');
if (!containsKeyword(UPDATELOG_FORMAT.format(updateTime), keyword) && !containsKeyword(updateTitle, keyword)) {
continue;
}
}
if (isValidLogInfo(updateTitle)) {
updateInfoList.add(new Object[]{UPDATE_INFO_TABLE_FORMAT.format(updateTime), updateVersionStr, updateTitle, updateTime.after(curJarDate)});
updateInfoList.add(new Object[]{updateTimeStr, updateVersionStr, updateTitle, updateTime.after(curJarDate)});
}
}
return new ArrayList<>(updateInfoList);

Loading…
Cancel
Save