Hi, the fix looks good, but why do you want to convert the seconds to milliseconds again at the end?
I think the intention of the method is to return a value in seconds with a five second resolution. we definitively need to add javadoc :-/ Regards Marcel > -----Original Message----- > From: Chetan Mehrotra [mailto:[email protected]] > Sent: Donnerstag, 27. März 2014 18:05 > To: [email protected] > Subject: [DocumentNodeStore] Clarify behaviour for Commit.getModified > > Hi, > > Currently Commit.getModified has following impl > > ----- > public static long getModified(long timestamp) { > // 5 second resolution > return timestamp / 1000 / 5; > } > ----- > > The result when treated as timestamp cause the time to set to 0 i.e. 1970 > > I intend to fix this with (looking at comment) > > ----- > public static long getModified(long timestamp) { > long timeInSec = TimeUnit.MILLISECONDS.toSeconds(timestamp); > timeInSec = timeInSec - timeInSec % 5; > return TimeUnit.SECONDS.toMillis(timeInSec); > } > ----- > > Would that be correct approach? > > Chetan Mehrotrarted
