LoadedClass(Class c) {
this.c = c;
- Field[] fields = c.getFields();
- f = new IBinaryField[fields.length];
- for (int i=0; i < f.length; i++) f[i] = new LoadedField(fields[i]);
+ Field[] fields = c.getDeclaredFields();
+ List flist = new ArrayList(fields.length);
+ for (int i=0; i < fields.length; i++)
+ if (!Modifier.isPrivate(fields[i].getModifiers()))
+ flist.add(new LoadedField(fields[i]));
+ f = new IBinaryField[flist.size()];
+ flist.toArray(f);
Class[] interfaces = c.getInterfaces();
inf = new char[interfaces.length][];
Constructor[] constructors = c.getDeclaredConstructors();
Method[] methods = c.getDeclaredMethods();
if (methods.length + constructors.length > 0) {
- meth = new IBinaryMethod[methods.length + constructors.length];
- int i=0;
+ List m = new ArrayList(methods.length + constructors.length);
for (int j=0; j < methods.length; j++)
- meth[i++] = new LoadedMethod(methods[j]);
+ if (!Modifier.isPrivate(methods[j].getModifiers()))
+ m.add(new LoadedMethod(methods[j]));
for (int j=0; j < constructors.length; j++)
- meth[i++] = new LoadedConstructor(constructors[j]);
+ if (!Modifier.isPrivate(constructors[j].getModifiers()))
+ m.add(new LoadedConstructor(constructors[j]));
+ meth = new IBinaryMethod[m.size()]; m.toArray(meth);
}
-
}
public char[] getName() { return name(c); }