question: public static boolean isNewer ( long ts1 , long size1 , long ts2 , long size2 ) { return ts1 > ts2 || ( ts1 == ts2 && size1 < size2 ) ; }
target:  Determines if a file is newer than another by comparing the timestamps and sizes. This heuristic is consisten with the behavior of rotating log files: at the instant the file is rotated there will likely exist two files with the same timestamp; in that case, knowing nothing else about the files, the old file is almost certainly the one which has more data, since the newer file has just been created (or truncated) and would not have enough data yet. TODO: The edge case where the new file fills so quickly (within 1 second) to become as large as the old file will escape this heuristic. This is *exceedingly rare* to happen in reality however, and will soon rectify itself (within 1 second) since the timestamp of the file that's being written to will change, and the sizes won't matter anymore.