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]



Reply via email to