ConstructorInfo[] constructors = classInfo.getConstructors();
Arrays.sort(
constructors, new Comparator() {
public int compare(Object o1, Object o2) {
try {
ConstructorInfo c1 = (ConstructorInfo) o1;
ConstructorInfo c2 = (ConstructorInfo) o2;
return c1.getSignature().compareTo(c2.getSignature());
} catch (Exception e) {
throw new WrappedRuntimeException(e);
}
}
}
);
for (int i = 0; i < constructors.length; i++) {
ConstructorInfo constructor = constructors[i];
int mods = constructor.getModifiers();
if ((mods & Constants.ACC_PRIVATE) == 0) {
out.writeUTF(INIT_METHOD_NAME);
out.writeInt(mods);
out.writeUTF(constructor.getSignature().replace('/', '.'));
}
}
// handle regular methods.
Arrays.sort(