static int changeDate ( int currentDate , int previousDate ) {
  char [ ] dateChars = String . valueOf ( currentDate ) . toCharArray ( ) ;
  int min = 9999 ;
  for ( int i = 0 ;
  i < dateChars . length ;
  i ++ ) {
    char tmp = dateChars [ i ] ;
    for ( char c = '0' ;
    c <= '9' ;
    c ++ ) {
      dateChars [ i ] = c ;
      int year = Integer . parseInt ( String . valueOf ( dateChars ) ) ;
      if ( year <= 2011 && year >= previousDate && year < min ) {
        min = year ;
      }
    }
    dateChars [ i ] = tmp ;
  }
  return min ;
}

static int changeDate ( int currentDate , int previousDate ) { char [ ] dateChars = String . valueOf ( currentDate ) . toCharArray ( ) ; int min = 9999 ; for ( int i = 0 ; i < dateChars . length ; i ++ ) { char tmp = dateChars [ i ] ; for ( char c = '0' ; c <= '9' ; c ++ ) { dateChars [ i ] = c ; int year = Integer . parseInt ( String . valueOf ( dateChars ) ) ; if ( year <= 2011 && year >= previousDate && year < min ) { min = year ; } } dateChars [ i ] = tmp ; } return min ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (character_literal))) condition: (binary_expression left: (identifier) right: (character_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier))) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))) (return_statement (identifier))))