private void arrayFillDefaultValue ( Object arr ) { if ( null == arr ) return ; Class < ? > clas = arr . getClass ( ) ; Class < ? > comp = Types . arrayElementType ( clas ) ; if ( ! comp . isPrimitive ( ) ) if ( Types . arrayDimensions ( clas ) > 1 ) for ( int i = 0 ; i < Array . getLength ( arr ) ; i ++ ) arrayFillDefaultValue ( Array . get ( arr , i ) ) ; else Arrays . fill ( ( Object [ ] ) arr , Primitive . unwrap ( Primitive . getDefaultValue ( comp ) ) ) ; }
Fill boxed numeric types with default numbers instead of nulls .