Message283
OK, OK forget all of the above "fixes". this bug is the same type of bug
as demonstrated in BUG#122847
my workaround is to add a method to PyJavaClass (see below) that returns only the public interfaces of a class; and then change __init_bases to:
Class[] interfaces=getAccessibleInterfaces(c);
This fixes up the problem above. Similar alteratertions to
getAccessibleMethods(), getAccessibleFields() and getAccessibleConstructors()
in PyJavaClass fixes BUG#122847
//----
private static Class[] filterPublic(Class[] in) {
java.util.Vector v=new java.util.Vector();
for(int i=0;i<in.length;i++) {
if(!Modifier.isPublic(in[i].getModifiers())) continue;
v.addElement(in[i]);
}
if(v.size()==in.length) return in;
Class[] ret = new Class[v.size()];
v.copyInto(ret);
return ret;
}
private static Class[] getAccessibleInterfaces(Class c) {
// can't modify accessibility of interfaces in Java2
// thus get only public interfaces
return filterPublic(c.getInterfaces());
} |
|
Date |
User |
Action |
Args |
2008-02-20 17:16:48 | admin | link | issue232462 messages |
2008-02-20 17:16:48 | admin | create | |
|