@ SuppressWarnings ( "checkstyle:cyclomaticcomplexity" ) void updateSizes ( int fieldLength , int decimalPointPosition ) { switch ( this . type ) { case STRING : if ( fieldLength > this . length ) { this . length = fieldLength ; } break ; case FLOATING_NUMBER : case NUMBER : if ( decimalPointPosition > this . decimal ) { final int intPart = this . length - this . decimal ; this . decimal = decimalPointPosition ; this . length = intPart + this . decimal ; } if ( fieldLength > this . length ) { this . length = fieldLength ; } break ; //$CASES-OMITTED$ default : // Do nothing } }
Update the sizes with the given ones if and only if they are greater than the existing ones . This test is done according to the type of the field .