On Monday, March 3, 2003, at 11:13 AM, Ryan Christianson wrote:
The class JetspeedIdGeneratorService has the method in cvs:
public String getNextPeid()
{
synchronized(JetspeedIdGeneratorService.class)
{
idCounter++;
}
return peidPrefix + Long.toHexString(System.currentTimeMillis()) + "-" + Long.toHexString(idCounter) + peidSuffix;
}
It seems to me that this would be more thread save:
public String getNextPeid()
{
long newId;
synchronized(JetspeedIdGeneratorService.class)
{
newId = idCounter++;
}
return peidPrefix + Long.toHexString(System.currentTimeMillis()) + "-" + Long.toHexString(newId) + peidSuffix;
}
Otherwise the idCounter could be updated before the string is built.
Is the correct place to submit cvs changes like this?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- David Sean Taylor Bluesunrise Software [EMAIL PROTECTED] +01 707 773-4646
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
