mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
[288878] Method signature criteria in DsfSession.getEventHandlerMethods() incorrect. Also throw an exception if the method takes no parameters.
This commit is contained in:
parent
55abb6907c
commit
ce83ec8fc0
1 changed files with 1 additions and 1 deletions
|
@ -485,7 +485,7 @@ public class DsfSession
|
||||||
for (Method method : methods) {
|
for (Method method : methods) {
|
||||||
if (method.isAnnotationPresent(DsfServiceEventHandler.class)) {
|
if (method.isAnnotationPresent(DsfServiceEventHandler.class)) {
|
||||||
Class<?>[] paramTypes = method.getParameterTypes();
|
Class<?>[] paramTypes = method.getParameterTypes();
|
||||||
if (paramTypes.length > 1) {
|
if (paramTypes.length != 1) { // must have one and only param
|
||||||
throw new IllegalArgumentException("ServiceEventHandler method has incorrect number of parameters"); //$NON-NLS-1$
|
throw new IllegalArgumentException("ServiceEventHandler method has incorrect number of parameters"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
retVal.add(method);
|
retVal.add(method);
|
||||||
|
|
Loading…
Add table
Reference in a new issue