Hi, and thanks for the fast reply, here is an example call. I’ll hope everything is in sync because I’ve collected and synced these information during multiple runs:
boolean org.tmatesoft.svn.core.internal.wc.SVNFileUtil.compareFileTimestamps(long microseconds1, long microseconds2)
microseconds1 == 1643820964709620
microseconds2 == 1643820964741617
lastModifiedHasMicrosecondPrecision == false
java7BasciFileAttributesClazz == interface java.nio.file.attribute.BasicFileAttributes
isWindows == true
SVNJNAUtil.isJNAPresent() == true
which means the expression
(lastModifiedHasMicrosecondPrecision && java7BasciFileAttributesClazz != null) == false
which means the expression
(SVNJNAUtil.isJNAPresent() && !isWindows) == false
which means this will be executed: return (microseconds1 / 1000000) == (microseconds2 / 1000000)
and (microseconds1 / 1000000) == 1643820964
and (microseconds2 / 1000000) == 1643820964
it seems you are interested in the execution flow of:
final String javaVersion = System.getProperty("java.version");
if (javaVersion != null) {
final String[] versionParts = javaVersion.split("\\.");
if (versionParts.length >= 2) {
try {
final int majorVersion = Integer.parseInt(versionParts[0]);
final int minorVersion = Integer.parseInt(versionParts[1]);
if (majorVersion > MICROSECOND_PRECISION_JAVA_VERSION[0] ||
(majorVersion == MICROSECOND_PRECISION_JAVA_VERSION[0] &&
minorVersion >= MICROSECOND_PRECISION_JAVA_VERSION[1])) {
lastModifiedHasMicrosecondPrecision = true;
}
} catch (NumberFormatException e) {
//
}
}
}
MICROSECOND_PRECISION_JAVA_VERSION == [1, 9]
javaVersion == "1.8.0_222"
versionParts == [1, 8, 0_222]
majorVersion == 1
MICROSECOND_PRECISION_JAVA_VERSION[0] == 1
and therefore the if aborts because
majorVersion > MICROSECOND_PRECISION_JAVA_VERSION[0] == false
majorVersion == MICROSECOND_PRECISION_JAVA_VERSION[0] == true
minorVersion >= MICROSECOND_PRECISION_JAVA_VERSION[1] == false
Therefore
majorVersion > MICROSECOND_PRECISION_JAVA_VERSION[0] == false
(majorVersion == MICROSECOND_PRECISION_JAVA_VERSION[0] && minorVersion >= MICROSECOND_PRECISION_JAVA_VERSION[1]) == false
and the or is false and lastModifiedHasMicrosecondPrecision is not set to true.
Maybe because you’ve set private static final int[] MICROSECOND_PRECISION_JAVA_VERSION = {1, 9};
and compare with minorVersion >= MICROSECOND_PRECISION_JAVA_VERSION[1]
but Java 1.8 supports it?
An additional information for long org.tmatesoft.svn.core.internal.wc.SVNFileUtil.getFileLastModifiedMicros(File file): file: C:\Users\bladenth\AppData\Local\Temp\junit4034958446396248862\junit8812005949469529045\DummyPojo.json
lastModifiedHasMicrosecondPrecision == false
java7BasciFileAttributesClazz == interface java.nio.file.attribute.BasicFileAttributes
SVNJNAUtil.isJNAPresent() == true
so we are going inside
//2. If this is not possible, try using JNA-based solution
which means we are going into
Long org.tmatesoft.svn.core.internal.util.jna.SVNJNAUtil.getLastModifiedMicros(File file)
isJNAPresent() == true
which executes
SVNLinuxUtil.getLastModifiedMicros(file)
but cLibrary == null
and returns the method with null
timeMicros == null
java7BasciFileAttributesClazz == interface java.nio.file.attribute.BasicFileAttributes
so we are going inside
//3. If the previous approach didn't succeed, try Java 7 if it's available
which means we are executing
final Long timeMicros = getLastModifiedMicrosJava7(file);
path == C:\Users\bladenth\AppData\Local\Temp\junit4034958446396248862\junit8812005949469529045\DummyPojo.json
attrs == sun.nio.fs.WindowsFileAttributes@37095ded {creationTime == 132882945647096201, lastAccessTime == 132882945647416178, lastWriteTime == 132882945647416178}
time == FileTime {value == 1643820964741617, valueAsString == 2022-02-02T16:56:04.741617Z }
therefore this will be executed
final Object result = java7toTimeMethod.invoke(time, TimeUnit.MICROSECONDS);
and the result is
1643820964741617
which will be returned upwards up to assembleStatus