Message283

Author ianzsk
Recipients
Date 2001-02-16.06:58:10
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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());

    }
History
Date User Action Args
2008-02-20 17:16:48adminlinkissue232462 messages
2008-02-20 17:16:48admincreate