diff --git a/platform/platform-api/src/com/intellij/ui/components/MouseWheelEventEx.java b/platform/platform-api/src/com/intellij/ui/components/MouseWheelEventEx.java index d0f1b14fdd4a..21d1fc26d9cd 100644 --- a/platform/platform-api/src/com/intellij/ui/components/MouseWheelEventEx.java +++ b/platform/platform-api/src/com/intellij/ui/components/MouseWheelEventEx.java @@ -27,7 +27,7 @@ import java.awt.event.MouseWheelEvent; * an implementation for Mac OS X). */ class MouseWheelEventEx { - private static final MethodInvocator ourGetScrollingDeltaMethod = new MethodInvocator(MouseWheelEvent.class, "getScrollingDelta"); + private static final MethodInvocator ourGetScrollingDeltaMethod = new MethodInvocator(false, MouseWheelEvent.class, "getScrollingDelta"); /** * Returns scrolling delta as an absolute value (if available). diff --git a/platform/util/src/com/intellij/util/MethodInvocator.java b/platform/util/src/com/intellij/util/MethodInvocator.java index 3267b0677bd0..f9cba3855c7a 100644 --- a/platform/util/src/com/intellij/util/MethodInvocator.java +++ b/platform/util/src/com/intellij/util/MethodInvocator.java @@ -26,6 +26,10 @@ public class MethodInvocator { private Method myMethod; public MethodInvocator(Class aClass, String method, Class... parameterTypes) { + this(true, aClass, method, parameterTypes); + } + + public MethodInvocator(boolean warnIfAbsent, Class aClass, String method, Class... parameterTypes) { try { myMethod = aClass.getDeclaredMethod(method, parameterTypes); @@ -34,7 +38,9 @@ public class MethodInvocator { } } catch (NoSuchMethodException e) { - LOG.warn("Method not found: " + aClass.getName() + "." + method); + if (warnIfAbsent) { + LOG.warn("Method not found: " + aClass.getName() + "." + method); + } } }