Browse Source

Merge pull request #17304 in DESIGN/design from release/11.0 to bugfix/11.0

* commit 'c039946000c0bd02e3f5b91902f51c1ba10773ca':
  REPORT-153340 代码中部分资源流未关闭,使用 try-with-resources 自动关闭流
bugfix/11.0
superman 2 weeks ago
parent
commit
c604544efe
  1. 11
      designer-base/src/main/java/com/fr/design/RestartHelper.java

11
designer-base/src/main/java/com/fr/design/RestartHelper.java

@ -110,8 +110,8 @@ public class RestartHelper {
private static boolean deleteWhenDebug() {
File ff = new File(RECORD_FILE);
Properties properties = new Properties();
try {
properties.load(new FileInputStream(ff));
try (FileInputStream fis = new FileInputStream(ff)) {
properties.load(fis);
} catch (IOException ignore) {
return true;
}
@ -163,7 +163,6 @@ public class RestartHelper {
}
/**
* 重启设计器并删除某些特定的文件
*
@ -180,13 +179,13 @@ public class RestartHelper {
try {
File restartLockFile = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), "restart.lock"));
StableUtils.makesureFileExist(restartLockFile);
randomAccessFile = new RandomAccessFile(restartLockFile,"rw");
randomAccessFile = new RandomAccessFile(restartLockFile, "rw");
FileChannel restartLockFC = randomAccessFile.getChannel();
FileLock restartLock = restartLockFC.tryLock();
if(restartLock == null) {
if (restartLock == null) {
FineLoggerFactory.getLogger().error("restart lock null!");
}
}catch (Exception e){
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
restartAction.execute(filesToBeDelete);

Loading…
Cancel
Save