<awangdev>Compare Version Numbers_1.java
public int compareVersion(String version1, String version2) {
        if (version1.equals(version2)) {
            return 0;
        }
        String[] subVersion1 = version1.split("\\.");
        String[] subVersion2 = version2.split("\\.");
        int size = Math.max(subVersion1.length, subVersion2.length);
        int rst = 0;
        for (int i = 0; i < size; i++) {
            if (i >= subVersion1.length) {
                rst = Integer.parseInt(subVersion2[i]) == 0 ? 0 : -1; 
            } else if (i >= subVersion2.length) {
                rst = Integer.parseInt(subVersion1[i]) == 0 ? 0 : 1; 
            } else { 
                if (Integer.parseInt(subVersion1[i]) != Integer.parseInt(subVersion2[i])) {
                    rst = Integer.parseInt(subVersion1[i]) < Integer.parseInt(subVersion2[i]) ? -1 : 1;    
                }
            }
            if (rst != 0) {
                return rst;
            }
        }
        return rst;
    }
public int sample_funcname ( String var_1 , String var_2 ) {
  if ( var_1 . equals ( var_2 ) ) {
    return 0 ;
  }
  String [ ] var_7 = var_1 . split ( "\\." ) ;
  String [ ] var_8 = var_2 . split ( "\\." ) ;
  int var_12 = Math . max ( var_7 . length , var_8 . length ) ;
  int var_13 = 0 ;
  for ( int var_14 = 0 ;
  var_14 < var_12 ;
  var_14 ++ ) {
    if ( var_14 >= var_7 . length ) {
      var_13 = Integer . parseInt ( var_8 [ var_14 ] ) == 0 ? 0 : - 1 ;
    }
    else if ( var_14 >= var_8 . length ) {
      var_13 = Integer . parseInt ( var_7 [ var_14 ] ) == 0 ? 0 : 1 ;
    }
    else {
      if ( Integer . parseInt ( var_7 [ var_14 ] ) != Integer . parseInt ( var_8 [ var_14 ] ) ) {
        var_13 = Integer . parseInt ( var_7 [ var_14 ] ) < Integer . parseInt ( var_8 [ var_14 ] ) ? - 1 : 1 ;
      }
    }
    if ( var_13 != 0 ) {
      return var_13 ;
    }
  }
  return var_13 ;
}
