- // early detection of whether it is an array of entities
- // to avoid performance problems.
- EntityAccessor accessor = PersistentFactory
- .createEntityAccessor(returnType.getComponentType());
- if (accessor != null) {
- Object[] merged = (Object[]) getter.invoke(aMerged);
- Object[] persistent = (Object[]) getter
- .invoke(aPersistent);
- if (merged.length != persistent.length) {
- throw new IllegalArgumentException("Array sizes differ " + merged.length +
- " " + persistent.length);
- }
- for (int i = 0; i < persistent.length; i++) {
- processPersistent(merged[i], persistent[i],
- aProcessed);
- }
+ Object[] merged = (Object[]) getter.invoke(aMerged);
+ Object[] persistent = (Object[]) getter
+ .invoke(aPersistent);
+ if (merged.length != persistent.length) {
+ throw new IllegalArgumentException(
+ "Array sizes differ " + merged.length + " " +
+ persistent.length);
+ }
+ for (int i = 0; i < persistent.length; i++) {
+ processPersistent(merged[i], persistent[i],
+ aProcessed);