mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup: extract duplicating strings to constants and add comments to them
This commit is contained in:
+2
-1
@@ -42,6 +42,7 @@ public class UpdateCheckerComponent implements Disposable, ApplicationComponent
|
||||
|
||||
private static final long CHECK_INTERVAL = DateFormatUtil.DAY;
|
||||
static final String SELF_UPDATE_STARTED_FOR_BUILD_PROPERTY = "ide.self.update.started.for.build";
|
||||
private static final String ERROR_LOG_FILE_NAME = "idea_updater_error.log";//must be equal to com.intellij.updater.Runner.ERROR_LOG_FILE_NAME
|
||||
|
||||
private final Alarm myCheckForUpdatesAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
|
||||
private final Runnable myCheckRunnable = () -> UpdateChecker.updateAndShowResult().doWhenProcessed(() -> queueNextCheck(CHECK_INTERVAL));
|
||||
@@ -131,7 +132,7 @@ public class UpdateCheckerComponent implements Disposable, ApplicationComponent
|
||||
private static void checkIfPreviousUpdateFailed() {
|
||||
PropertiesComponent properties = PropertiesComponent.getInstance();
|
||||
if (ApplicationInfo.getInstance().getBuild().asString().equals(properties.getValue(SELF_UPDATE_STARTED_FOR_BUILD_PROPERTY))) {
|
||||
File updateErrorsLog = new File(PathManager.getLogPath(), "idea_updater_error.log");
|
||||
File updateErrorsLog = new File(PathManager.getLogPath(), ERROR_LOG_FILE_NAME);
|
||||
try {
|
||||
if (updateErrorsLog.isFile() && !StringUtil.isEmptyOrSpaces(FileUtil.loadFile(updateErrorsLog))) {
|
||||
FUSApplicationUsageTrigger.getInstance().trigger(IdeUpdateUsageTriggerCollector.class, "update.failed");
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.zip.ZipInputStream;
|
||||
|
||||
public class Runner {
|
||||
private static final String PATCH_FILE_NAME = "patch-file.zip";
|
||||
private static final String ERROR_LOG_FILE_NAME = "idea_updater_error.log";//must be equal to com.intellij.openapi.updateSettings.impl.UpdateCheckerComponent.ERROR_LOG_FILE_NAME
|
||||
|
||||
private static Logger logger = null;
|
||||
private static String logPath = null;
|
||||
@@ -159,7 +160,7 @@ public class Runner {
|
||||
update.activateOptions();
|
||||
|
||||
FileAppender updateError = new FileAppender();
|
||||
updateError.setFile(new File(logDirectory, "idea_updater_error.log").getAbsolutePath());
|
||||
updateError.setFile(new File(logDirectory, ERROR_LOG_FILE_NAME).getAbsolutePath());
|
||||
updateError.setLayout(new PatternLayout("%d{dd/MM HH:mm:ss} %-5p %C{1}.%M - %m%n"));
|
||||
updateError.setThreshold(Level.ERROR);
|
||||
updateError.setAppend(false);
|
||||
|
||||
Reference in New Issue
Block a user