make converted condition match the previous logic

This commit is contained in:
Alexey Kudravtsev
2016-05-27 12:31:06 +03:00
parent c1ea2b5928
commit 58c08e4d5a
2 changed files with 4 additions and 6 deletions
@@ -564,7 +564,7 @@ public class IdeEventQueue extends EventQueue {
enterSuspendModeIfNeeded(e);
}
myKeyboardBusy = myKeyboardEventsInTheQueue.get() != 0;
myKeyboardBusy = e instanceof KeyEvent || myKeyboardEventsInTheQueue.get() != 0;
if (e instanceof KeyEvent) {
if (e.getID() == KeyEvent.KEY_RELEASED && ((KeyEvent)e).getKeyCode() == KeyEvent.VK_SHIFT) {
@@ -26,12 +26,10 @@ public class IdeEventQueueTest extends PlatformTestCase {
public void testManyEvents() {
int N = 100000;
PlatformTestUtil.startPerformanceTest("Event queue dispatch", 10000, () -> {
AtomicInteger count = new AtomicInteger();
UIUtil.dispatchAllInvocationEvents();
for (int i=0;i<N;i++) {
SwingUtilities.invokeLater(() -> {
count.incrementAndGet();
});
AtomicInteger count = new AtomicInteger();
for (int i = 0; i < N; i++) {
SwingUtilities.invokeLater(count::incrementAndGet);
}
UIUtil.dispatchAllInvocationEvents();
assertEquals(N, count.get());