diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java index 83cbd7985e40..31246ea8027f 100644 --- a/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java +++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java @@ -116,7 +116,7 @@ public class ActionUtil { final boolean isSlow = ud.averageUpdateDurationMs > 10;// empiric val: 10 ms final long startTimeNs = System.nanoTime(); final long relaxMs = Math.min(ud.averageUpdateDurationMs*100, 10000); // empiric vals: min 1 sec, max 10 sec - if (isSlow && ud.lastUpdateEvent != null && (forceUseCached || (startTimeNs - ud.lastUpdateTimeNs)/1000000l < relaxMs)) { + if (isSlow && ud.lastUpdateEvent != null && (forceUseCached || (startTimeNs - ud.lastUpdateTimeNs) / 1000000L < relaxMs)) { // System.out.println("use cached presentation for action '" + String.valueOf(action) + "', averageUpdateDuration=" + ud.averageUpdateDurationMs + " ms, " + (startTimeNs - ud.lastUpdateTimeNs)/1000000l + " ms elapsed from last update"); event.getPresentation().copyFrom(ud.lastUpdateEvent.getPresentation()); return; @@ -130,7 +130,7 @@ public class ActionUtil { final float smoothAlpha = isSlow ? 0.8f : 0.3f; final float smoothCoAlpha = 1 - smoothAlpha; - final long spentMs = (finishUpdateNs - startTimeNs)/1000000l; + final long spentMs = (finishUpdateNs - startTimeNs) / 1000000L; ud.averageUpdateDurationMs = Math.round(spentMs*smoothAlpha + ud.averageUpdateDurationMs*smoothCoAlpha); } diff --git a/platform/platform-impl/src/com/intellij/ui/mac/touchbar/TouchBar.java b/platform/platform-impl/src/com/intellij/ui/mac/touchbar/TouchBar.java index e3eae4913593..7417b47c97f4 100644 --- a/platform/platform-impl/src/com/intellij/ui/mac/touchbar/TouchBar.java +++ b/platform/platform-impl/src/com/intellij/ui/mac/touchbar/TouchBar.java @@ -239,7 +239,7 @@ class TouchBar implements NSTLibrary.ItemCreator { // When user types text and presses modifier keys it causes to show alternative touchbar layouts, some of them are visible less than second. // To avoid unnecessary slow-update invocations for such bars we always try to use cached presentations for the first 500 ms (for slow actions only) final long elapsedFromStartShowNs = System.nanoTime() - myStartShowNs; - final boolean forceUseCached = elapsedFromStartShowNs < 500*1000000l; + final boolean forceUseCached = elapsedFromStartShowNs < 500 * 1000000L; final boolean[] layoutChanged = new boolean[]{false}; forEachDeep(tbitem->{ diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java index d0654286d10c..a27735d1145f 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java @@ -201,7 +201,7 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { myResultsViewer.performUpdate(); PlatformTestUtil.waitWhileBusy(myResultsViewer.getTreeView()); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10L)); myResultsViewer.performUpdate(); PlatformTestUtil.waitWhileBusy(myResultsViewer.getTreeView()); @@ -211,7 +211,7 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { assertEquals(2, myTreeModel.getChildCount(myTreeModel.getChild(myTreeModel.getRoot(), 0))); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10L)); PlatformTestUtil.waitWhileBusy(myResultsViewer.getTreeView()); assertEquals(2, myTreeModel.getChildCount(myTreeModel.getChild(myTreeModel.getRoot(), 0))); @@ -233,13 +233,13 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { myResultsViewer.performUpdate(); myEventsProcessor.onTestFailure(new TestFailedEvent("test_failed", "", "", false, null, null)); myResultsViewer.performUpdate(); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10L)); myResultsViewer.performUpdate(); myEventsProcessor.onTestStarted(new TestStartedEvent("test", null)); myResultsViewer.performUpdate(); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10L)); myResultsViewer.performUpdate(); myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite2")); @@ -279,7 +279,7 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { myResultsViewer.performUpdate(); myEventsProcessor.onTestFailure(new TestFailedEvent("test1", "", "", false, "a", "b")); myResultsViewer.performUpdate(); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test1", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test1", 10L)); myResultsViewer.performUpdate(); myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite1")); myResultsViewer.performUpdate(); @@ -308,7 +308,7 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { myEventsProcessor.onTestFailure(new TestFailedEvent("test1", "", "", false, "a", "b")); myResultsViewer.performUpdate(); - myEventsProcessor.onTestFinished(new TestFinishedEvent("test1", 10l)); + myEventsProcessor.onTestFinished(new TestFinishedEvent("test1", 10L)); myResultsViewer.performUpdate(); myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite1")); myResultsViewer.performUpdate(); diff --git a/platform/util/testSrc/com/intellij/util/FoundationTest.java b/platform/util/testSrc/com/intellij/util/FoundationTest.java index 4ea11e590f36..ca697f809c88 100644 --- a/platform/util/testSrc/com/intellij/util/FoundationTest.java +++ b/platform/util/testSrc/com/intellij/util/FoundationTest.java @@ -53,10 +53,10 @@ public class FoundationTest { assertThat(Foundation.getEncodingName(10), equalTo("utf-16")); assertThat(Foundation.getEncodingCode("utf-16"), equalTo(10L)); - assertThat(Foundation.getEncodingName(2483028224l), equalTo("utf-16le")); - assertThat(Foundation.getEncodingCode("utf-16le"), equalTo(2483028224l)); - assertThat(Foundation.getEncodingName(2415919360l), equalTo("utf-16be")); - assertThat(Foundation.getEncodingCode("utf-16be"), equalTo(2415919360l)); + assertThat(Foundation.getEncodingName(2483028224L), equalTo("utf-16le")); + assertThat(Foundation.getEncodingCode("utf-16le"), equalTo(2483028224L)); + assertThat(Foundation.getEncodingName(2415919360L), equalTo("utf-16be")); + assertThat(Foundation.getEncodingCode("utf-16be"), equalTo(2415919360L)); } @Test