Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.9.3.21, 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1 M1
-
Fix Version/s: 1.1 M2
-
Component/s: XML code generator
-
Labels:None
-
Environment:Operating System: Windows 2000
Platform: PC
-
Bugzilla Id:1043
-
Number of attachments :
Description
The methode getExtends() of generated FieldDescriptor class always returns null:
class AFieldDescriptor extends BFieldDescriptor
{
public void getExtends()
{ return super.getExtends() }}
Resolution:
class AClassDescriptor extends BClassDescriptor
{
public ClassDescriptorgetExtends()
}
Solution of this problem:
class AClassDescriptor extends BClassDescriptor
{
public ClassDescriptor getExtends()
}
The solution is not as simple as that, because all the generated descriptors
eventually extend XMLClassDescriptorImpl, so simply return super; will cause
getExtends() to incorrectly return a non-null value. So we'll have to provide
some additional checks. ClassDescriptor#getExtends() doesn't necessary mean that
the Class itself extends (in the Java sense) any particular Class, #getExtends()
can return any ClassDescriptor that the said ClassDescriptor should inherit
from, even if the implementation doens't extend it programmatically.
For example:
AClassDescriptor implements XMLClassDescriptor {
private ClassDescriptor _inheritFrom = new BClassDescriptor();
public ClassDescriptor getExtends() { return _inheritFrom; }
}
Should be treated the same as:
AClassDescriptor extends BClassDescriptor {
public ClassDescriptor getExtends() { return super; }
}
But the following would be incorrect...
BClassDescriptor extends XMLClassDescriptorImpl {
public ClassDescriptor getExtends() { return super; } }
}
I'm assigning this to Arnaud so that he can look into it further...