Skip to content

Commit a0a0ef8

Browse files
EcljpseB0Tjukzi
authored andcommitted
ToolItemUpdater: fix possible Integer overflow
Both DELAY and 1_000_000 are Integers. Multiplied they could exceed max integer. Currently the DELAY is small enough to not overflow, but changing the constant would silently overflow.
1 parent 9d544d5 commit a0a0ef8

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt

1 file changed

+1
-1
lines changed

bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemUpdater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void updateContributionItems(Selector selector) {
5555
if (timestampOfEarliestQueuedUpdate == 0) {
5656
timestampOfEarliestQueuedUpdate = System.nanoTime();
5757
}
58-
if (System.nanoTime() - timestampOfEarliestQueuedUpdate > DELAY * 1_000_000) {
58+
if (System.nanoTime() - timestampOfEarliestQueuedUpdate > DELAY * 1_000_000L) {
5959
// runnable was not called within the last DELAY milliseconds, do it now.
6060
// For scenario: a plugin is forcing that updateContributionItems is called
6161
// again and again in less than given DELAY frequency. TimerExec would then

0 commit comments

Comments
 (0)