//prefOCD.length should == prefConfs.length
private PrefPage[] composePrefPages(ServiceReference prefHolder, PreferenceOCD[] prefOCDs, Configuration[] prefConfs, int type) {
int minLength = Math.min(prefOCDs.length, prefConfs.length);
List composedPrefPageList = new ArrayList(prefOCDs.length);
for (int ii = 0; ii < minLength; ii++) {
PrefPage composedPrefPage = new PrefPageImpl(prefHolder, prefOCDs[ii], prefConfs[ii], type);
composedPrefPageList.add(composedPrefPage);
}
return (PrefPage[]) composedPrefPageList.toArray(new PrefPage[composedPrefPageList.size()]);
}