You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry I can't commit code from work, otherwise I would :-(
There seem to be 2 issues.
Commit time should be converted from int to long before conversion to Date (lines 253-256):
int timeSinceEpoch = headCommit.getCommitTime();
Date commitDate = new Date(timeSinceEpoch * 1000); // git is "by sec" and java is "by ms"
SimpleDateFormat smf = new SimpleDateFormat(dateFormat);
put(properties, prefixDot + COMMIT_TIME, smf.format(commitDate));
Since timeSinceEpoch is something like 1305045215, multiplying by 1000 exceeds MAX_INT and makes it negative. Line 253 should be something like:
long timeSinceEpoch = new Integer(headCommit.getCommitTime()).longValue();
loadBuildTimeData() is overwriting the same property that the above code is setting (lines 191-193):
Date commitDate = new Date();
SimpleDateFormat smf = new SimpleDateFormat(dateFormat);
put(properties, prefixDot + COMMIT_TIME, smf.format(commitDate));
Create a new const BUILD_TIME, and use that instead.
The effect of both of these is that ${git.commit.time} actually gives me the build time, which in my case is not the end of the world (it's "close enough"), but it could be very misleading.
The text was updated successfully, but these errors were encountered:
Hi and thanks a lot for your contribution!
I'll look right into it (when I come home) - we're at the geecon.org hackergarten right now, so it's great we'd be able to fix yet another bug during this day :-)
Sorry I can't commit code from work, otherwise I would :-(
There seem to be 2 issues.
Since timeSinceEpoch is something like 1305045215, multiplying by 1000 exceeds MAX_INT and makes it negative. Line 253 should be something like:
Create a new const BUILD_TIME, and use that instead.
The effect of both of these is that ${git.commit.time} actually gives me the build time, which in my case is not the end of the world (it's "close enough"), but it could be very misleading.
The text was updated successfully, but these errors were encountered: