if (phased != null) { rollup = (AspectValue[]) rollup.clone(); for (int i = 0; i < phased.length; i++) { AspectValue av = phased[i]; if (av != null) rollup[av.getAspectType()] = av; } } int nAspects = 0; for (int i = 0; i < rollup.length; i++) { if (rollup[i] != null) nAspects++; } AspectValue[] result = new AspectValue[nAspects]; int aspect = 0; for (int i = 0; i < rollup.length; i++) { if (rollup[i] != null) result[aspect++] = rollup[i]; } return result;
if (phased != null) { rollup = (AspectValue[]) rollup.clone(); for (int i = 0; i < phased.length; i++) { AspectValue av = phased[i]; if (av != null) rollup[av.getAspectType()] = av;
        private AspectValue[] merge(AspectValue[] rollup, AspectValue[] phased) {            if (phased != null) {                rollup = (AspectValue[]) rollup.clone(); // Don't clobber the original                for (int i = 0; i < phased.length; i++) {                    AspectValue av = phased[i];                    if (av != null) rollup[av.getAspectType()] = av;                }            }            int nAspects = 0;            for (int i = 0; i < rollup.length; i++) {                if (rollup[i] != null) nAspects++;            }            AspectValue[] result = new AspectValue[nAspects];            int aspect = 0;            for (int i = 0; i < rollup.length; i++) {                if (rollup[i] != null) result[aspect++] = rollup[i];            }            return result;        }