Richard Dale
2005-10-06 11:35:46 UTC
SVN commit 467774 by rdale:
* This check via reflection to tell if an event method had been
overriden was insufficiently herioc - I just love those java
apis ;). This should fix the bug reported by Jochen Becher
CCBUGS: 112409
CCMAIL: kde-***@kde.org
M +8 -4 Invocation.java
--- branches/KDE/3.5/kdebindings/qtjava/javalib/org/kde/qt/Invocation.java #467773:467774
@@ -442,11 +442,15 @@
Object onThis = qtjava.objectForQtKey(target, "org.kde.qt.QObject", false);
try {
- // Assume that an event handler is a protected method, so use getDeclaredMethod()
- method = onThis.getClass().getDeclaredMethod(methodName, parameterType);
+ method = onThis.getClass().getMethod(methodName, parameterType);
method.setAccessible(true);
- } catch (NoSuchMethodException e) {
- return false;
+ } catch (NoSuchMethodException e1) {
+ try {
+ method = onThis.getClass().getDeclaredMethod(methodName, parameterType);
+ method.setAccessible(true);
+ } catch (NoSuchMethodException e2) {
+ return true;
+ }
}
// Ignore any native code event handling methods
* This check via reflection to tell if an event method had been
overriden was insufficiently herioc - I just love those java
apis ;). This should fix the bug reported by Jochen Becher
CCBUGS: 112409
CCMAIL: kde-***@kde.org
M +8 -4 Invocation.java
--- branches/KDE/3.5/kdebindings/qtjava/javalib/org/kde/qt/Invocation.java #467773:467774
@@ -442,11 +442,15 @@
Object onThis = qtjava.objectForQtKey(target, "org.kde.qt.QObject", false);
try {
- // Assume that an event handler is a protected method, so use getDeclaredMethod()
- method = onThis.getClass().getDeclaredMethod(methodName, parameterType);
+ method = onThis.getClass().getMethod(methodName, parameterType);
method.setAccessible(true);
- } catch (NoSuchMethodException e) {
- return false;
+ } catch (NoSuchMethodException e1) {
+ try {
+ method = onThis.getClass().getDeclaredMethod(methodName, parameterType);
+ method.setAccessible(true);
+ } catch (NoSuchMethodException e2) {
+ return true;
+ }
}
// Ignore any native code event handling methods