src/main/java/io/github/gaol/git_rev_missing/Main.java
// return true if revA is larger than revB, false otherwise
return true if revA is larger than revB, false otherwise
return true if revA is larger than revB false otherwise
static boolean versionLarger(String revA, String revB) {
        String[] partsA = revA.split("\\.");
        String[] partsB = revB.split("\\.");
        for (int i=0, j=0; i < partsA.length || j < partsB.length;) {
            String partA = null, partB = null;
            if (i < partsA.length) {
                partA = partsA[i];
            }
            if (j < partsB.length) {
                partB = partsB[i];
            }
            if (partA != null && partB == null) {
                return true;
            }
            if (partA == null && partB != null) {
                return false;
            }
            int r = partCompare(partA, partB);
            if (r > 0) {
                return true;
            } else if (r < 0) {
                return false;
            }
            i++;
            j++;
        }
        return revA.compareTo(revB) > 0;
    }
static boolean versionLarger ( String revA , String revB ) { String [ ] partsA = revA . split ( "\\." ) ; String [ ] partsB = revB . split ( "\\." ) ; for ( int i = 0 , j = 0 ; i < partsA . length || j < partsB . length ; ) { String partA = null , partB = null ; if ( i < partsA . length ) { partA = partsA [ i ] ; } if ( j < partsB . length ) { partB = partsB [ i ] ; } if ( partA != null && partB == null ) { return true ; } if ( partA == null && partB != null ) { return false ; } int r = partCompare ( partA , partB ) ; if ( r > 0 ) { return true ; } else if ( r < 0 ) { return false ; } i ++ ; j ++ ; } return revA . compareTo ( revB ) > 0 ; }
return true if revA is larger than revB, false otherwise
return true if revA is larger than revB false otherwise