diff --git a/platform/platform-api/src/com/intellij/util/Alarm.java b/platform/platform-api/src/com/intellij/util/Alarm.java index 95f4cff822db..bc4b0e1faad0 100644 --- a/platform/platform-api/src/com/intellij/util/Alarm.java +++ b/platform/platform-api/src/com/intellij/util/Alarm.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.util; import com.intellij.openapi.Disposable; @@ -206,7 +192,7 @@ public class Alarm implements Disposable { _addRequest(request, delayMillis, modalityState); } - void _addRequest(@Debugger.Capture @NotNull Runnable request, long delayMillis, @Nullable ModalityState modalityState) { + void _addRequest(@NotNull Runnable request, long delayMillis, @Nullable ModalityState modalityState) { synchronized (LOCK) { checkDisposed(); final Request requestToSchedule = new Request(request, modalityState, delayMillis); @@ -347,6 +333,7 @@ public class Alarm implements Disposable { private Future myFuture; // guarded by LOCK private final long myDelay; + @Debugger.Capture private Request(@NotNull final Runnable task, @Nullable ModalityState modalityState, long delayMillis) { synchronized (LOCK) { myTask = task; @@ -411,6 +398,7 @@ public class Alarm implements Disposable { } } + @Debugger.Insert private void runSafely(@Nullable Runnable task) { try { if (!myDisposed && task != null) { diff --git a/platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java b/platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java index e1dabd2c2807..0dfbd4f5cc2e 100644 --- a/platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java +++ b/platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.util.concurrency; import com.intellij.openapi.application.Application; @@ -241,7 +227,7 @@ public class QueueProcessor { return true; } - public static void runSafely(@Debugger.Insert(group = "com.intellij.util.Alarm._addRequest") @NotNull Runnable run) { + public static void runSafely(@NotNull Runnable run) { try { run.run(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/LaterInvocator.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/LaterInvocator.java index 0dcd1db584ea..820278b8bd41 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/impl/LaterInvocator.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/LaterInvocator.java @@ -46,7 +46,8 @@ public class LaterInvocator { @NotNull private final Condition expired; @Nullable private final ActionCallback callback; - RunnableInfo(@Debugger.Capture @NotNull Runnable runnable, + @Debugger.Capture + RunnableInfo(@NotNull Runnable runnable, @NotNull ModalityState modalityState, @NotNull Condition expired, @Nullable ActionCallback callback) { @@ -428,7 +429,7 @@ public class LaterInvocator { if (lastInfo != null) { try { - doRun(lastInfo.runnable); + doRun(lastInfo); lastInfo.markDone(); } catch (ProcessCanceledException ignored) { } @@ -443,8 +444,8 @@ public class LaterInvocator { } // Extracted to have a capture point - private static void doRun(@Debugger.Insert Runnable runnable) { - runnable.run(); + private static void doRun(@Debugger.Insert RunnableInfo info) { + info.runnable.run(); } @Override