From ffd7f17564ce72849da675505a51f58296f7c23a Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Tue, 5 May 2015 14:16:08 +0300 Subject: [PATCH] USE_REFLECTION_TO_ACCESS_JDK7 --- .../platform-api/src/com/intellij/openapi/MnemonicWrapper.java | 3 +++ .../platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/platform/platform-api/src/com/intellij/openapi/MnemonicWrapper.java b/platform/platform-api/src/com/intellij/openapi/MnemonicWrapper.java index ae7792e57169..2c78265d1726 100644 --- a/platform/platform-api/src/com/intellij/openapi/MnemonicWrapper.java +++ b/platform/platform-api/src/com/intellij/openapi/MnemonicWrapper.java @@ -15,6 +15,7 @@ */ package com.intellij.openapi; +import com.intellij.Patches; import com.intellij.ide.ui.UISettings; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.registry.Registry; @@ -202,6 +203,8 @@ abstract class MnemonicWrapper implements Runnable, Propert // TODO: HACK because of Java7 required: // replace later with KeyEvent.getExtendedKeyCodeForChar(ch) private static int getExtendedKeyCodeForChar(int ch) { + //noinspection ConstantConditions + assert Patches.USE_REFLECTION_TO_ACCESS_JDK7; try { Method method = KeyEvent.class.getMethod("getExtendedKeyCodeForChar", int.class); if (!method.isAccessible()) { diff --git a/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java b/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java index b5f13ac91f7e..6743d619518d 100644 --- a/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java +++ b/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java @@ -15,6 +15,7 @@ */ package com.intellij.ui; +import com.intellij.Patches; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.registry.Registry; @@ -137,6 +138,8 @@ public class KeyStrokeAdapter implements KeyListener { // TODO: HACK because of Java7 required: // replace later with event.getExtendedKeyCode() private static int getExtendedKeyCode(KeyEvent event) { + //noinspection ConstantConditions + assert Patches.USE_REFLECTION_TO_ACCESS_JDK7; try { Method method = KeyEvent.class.getMethod("getExtendedKeyCode"); if (!method.isAccessible()) {