private void recordCallbacks(ClassMetaData cls,
Collection<LifecycleCallbacks>[] callbacks, int[] highs,
boolean superClass) {
if (callbacks == null)
return;
LifecycleMetaData meta = cls.getLifecycleMetaData();
LifecycleCallbacks[] array;
for (int event : LifecycleEvent.ALL_EVENTS) {
if (callbacks[event] == null)
continue;
array = callbacks[event].toArray
(new LifecycleCallbacks[callbacks[event].size()]);
if (superClass) {
meta.setNonPCSuperclassCallbacks(event, array,
(highs == null) ? 0 : highs[event]);
} else {
meta.setDeclaredCallbacks(event, array,
(highs == null) ? 0 : highs[event]);
}
}
}