isInterface() for abstract class
Status: Beta
Brought to you by:
tatsubori
Bug report:
OJClass.isInterface() is returning true for one of my classes
which is an abstract class. I haven't checked it out for any
others but assume that it always does this for abstract classes.
Request for workaround: is there any simple way to tell a real
interface from an abstract class? Or a quick fix for this bug?
thanks
Jim Goodwin
Logged In: YES
user_id=1895404
Originator: NO
There is a something wrong in the ClassDeclaration class
public ClassDeclaration(ModifierList modiflist, String name, TypeName[] baseclasses, TypeName[] ifaces,MemberDeclarationList fieldlist) {
this(modiflist, name, baseclasses, ifaces, fieldlist, true);
}
/****************************************************************************
The call to a fellow constructor using "this", the above constructor passes
the last value as true which is hard coded and _isInterface variable in
the constructor below will always be false...It looks like the isInterface
is not supposed to be working for now.
****************************************************************************/
public ClassDeclaration(ModifierList modiflist, String name, TypeName[] baseclasses, TypeName[] ifaces,
MemberDeclarationList fieldlist, boolean is_class) {
super();
baseclasses = (baseclasses == null) ? new TypeName[0] : baseclasses;
ifaces = (ifaces == null) ? new TypeName[0] : ifaces;
set(modiflist, name, baseclasses, ifaces, fieldlist);
this._isInterface = (!is_class);
}