In my test case, I have an abstract class, that then has
some classes which, I noticed one problem. If the base
class has member variables. They can't be set.
My fix is as follows:
The method is in ParameterDef.java
Here is the new code:
protected void bindToClass(Class clas) {
Class theClass = clas;
IllegalArgumentException ilException = null;
while ( theClass != null )
{
try {
m_field = theClass.getDeclaredField(m_name);
m_field.setAccessible(true);
return;
} catch (NoSuchFieldException ex) {
if ( ilException == null )
{
ilException = new IllegalArgumentException
("Field '" + m_name + "' not found in " +
theClass.getName());
}
theClass = theClass.getSuperclass();
}
}
throw ilException;
}
The problem comes up with inherited member variables.
Logged In: YES
user_id=335130
That's a good point. JArgP was set up with the assumption
that you'd use a separate list of parameter definitions for
the base class in a case like this, so that different
subclasses would still use the same parameter definitions
for everything that was inherited. There's no need to limit
it this way, though. I'll incorporate the change when I get
a chance.