Description
When a class has both a void method and a boolean isXxx() getter with related names, Beanshell 3.0.0-SNAPSHOT incorrectly invokes the property getter instead of the void method when calling xxx().
Example
public interface Shutter {
void up(); // Method I want to call
boolean isUp(); // Getter for "up" property
void down(); // This works correctly
boolean isDown(); // Getter for "down" property
}
The issue appears to be in bsh/Reflect.java:
invokeObjectMethod() (around line 54-80) attempts to resolve the method with resolveExpectedJavaMethod()
When this fails or in certain code paths, it falls back to property resolution
getObjectProperty() (around line 500-530) uses BshClassManager.memberCache.get(cls).findGetter(propName)
findGetter() matches the JavaBeans pattern and finds isUp() for property "up"
The property getter is invoked instead of the actual method