Yes, it's allowed as it doesn't change the contract but the implementation.
Think that you could always simply add a synchronized block :
synchronized(this) {
just at the start of the method, which would achieve about the same result. There could also be other (possibly hidden) locks deeper in the method, which makes this really part of the implementation rather than the API.