Well, I must disagree: I think BCEL should not try to foresee "where a developer wants to go today". So the InstructionFactory class (and corresponding Instruction subclasses) will be kept small, fast and clean; for example:
class BaseClass {
protected something;
}
class DerivedClass extends BaseClass{ protected something; }
the above declarations are perfectly correct; and the fields with same name are simply different fields (pls., avoid constructions like this:)). Then:
1. what should be the default field access?
2. How can we trace potentially huge number of classes fast and tricky?
3. And so on.
Same rules as a standard compiler.
getField("something");
if ( null ) getSuper().getField("something");The biggest frustration is the difference between static and virtual fields.
class Demo
{
protected something;
protected static otherThing;
}Currently both of these require a separate way of accessing them. The first is not static, so we can access it with:
Constants.GETFIELD
The second is static, so we have to access it with:
Constants.GETSTATIC
It is really simple to check the associated Field for whether it is static or not:
javaClass.getField("something").isStatic() ? GETSTATIC : GETFIELD
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
