From 8fb60004a2ea8264ebf9d5f9d358525390bd6624 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 16 Jun 2016 10:22:19 +0200 Subject: [PATCH] cleanup --- .../intellij/compiler/server/BuildManager.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java index 73c8a594e240..3e6a7a795947 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java @@ -146,8 +146,8 @@ public class BuildManager implements Disposable { private static final String IDEA_PROJECT_DIR_PATTERN = "/.idea/"; private static final Function PATH_FILTER = SystemInfo.isFileSystemCaseSensitive ? - (Function)s -> !(s.contains(IDEA_PROJECT_DIR_PATTERN) || s.endsWith(IWS_EXTENSION) || s.endsWith(IPR_EXTENSION)) : - (Function)s -> !(StringUtil.endsWithIgnoreCase(s, IWS_EXTENSION) || StringUtil.endsWithIgnoreCase(s, IPR_EXTENSION) || StringUtil.containsIgnoreCase(s, IDEA_PROJECT_DIR_PATTERN)); + s -> !(s.contains(IDEA_PROJECT_DIR_PATTERN) || s.endsWith(IWS_EXTENSION) || s.endsWith(IPR_EXTENSION)) : + s -> !(StringUtil.endsWithIgnoreCase(s, IWS_EXTENSION) || StringUtil.endsWithIgnoreCase(s, IPR_EXTENSION) || StringUtil.containsIgnoreCase(s, IDEA_PROJECT_DIR_PATTERN)); private final File mySystemDirectory; private final ProjectManager myProjectManager; @@ -307,9 +307,9 @@ public class BuildManager implements Disposable { } }); - ShutDownTracker.getInstance().registerShutdownTask(() -> stopListening()); + ShutDownTracker.getInstance().registerShutdownTask(this::stopListening); - ScheduledFuture future = JobScheduler.getScheduler().scheduleWithFixedDelay((Runnable)() -> runCommand(myGCTask), 3, 180, TimeUnit.MINUTES); + ScheduledFuture future = JobScheduler.getScheduler().scheduleWithFixedDelay(() -> runCommand(myGCTask), 3, 180, TimeUnit.MINUTES); Disposer.register(this, () -> future.cancel(false)); } @@ -464,7 +464,7 @@ public class BuildManager implements Disposable { final List scopes = CmdlineProtoUtil.createAllModulesScopes(false); final AutoMakeMessageHandler handler = new AutoMakeMessageHandler(project); final TaskFuture future = scheduleBuild( - project, false, true, false, scopes, Collections.emptyList(), Collections.emptyMap(), handler + project, false, true, false, scopes, Collections.emptyList(), Collections.emptyMap(), handler ); if (future != null) { myAutomakeFutures.put(future, project); @@ -681,13 +681,13 @@ public class BuildManager implements Disposable { final CmdlineRemoteProto.Message.ControllerMessage params; if (isRebuild) { - params = CmdlineProtoUtil.createBuildRequest(projectPath, scopes, Collections.emptyList(), userData, globals, null); + params = CmdlineProtoUtil.createBuildRequest(projectPath, scopes, Collections.emptyList(), userData, globals, null); } else if (onlyCheckUpToDate) { params = CmdlineProtoUtil.createUpToDateCheckRequest(projectPath, scopes, paths, userData, globals, currentFSChanges); } else { - params = CmdlineProtoUtil.createBuildRequest(projectPath, scopes, isMake ? Collections.emptyList() : paths, userData, globals, currentFSChanges); + params = CmdlineProtoUtil.createBuildRequest(projectPath, scopes, isMake ? Collections.emptyList() : paths, userData, globals, currentFSChanges); } if (!usingPreloadedProcess) { myMessageDispatcher.registerBuildMessageHandler(future, params); @@ -1333,7 +1333,7 @@ public class BuildManager implements Disposable { } private abstract static class BuildManagerPeriodicTask implements Runnable { - private final Alarm myAlarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD); + private final Alarm myAlarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD); private final AtomicBoolean myInProgress = new AtomicBoolean(false); private final Runnable myTaskRunnable = () -> { try {