]
Tom Jenkinson resolved JBTM-2201.
---------------------------------
Fix Version/s: 5.0.3
Resolution: Done
Thanks for the report and contribution!
Bug in STM example
------------------
Key: JBTM-2201
URL:
https://issues.jboss.org/browse/JBTM-2201
Project: JBoss Transaction Manager
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Documentation, STM
Affects Versions: 5.0.2
Reporter: Jonas Kongslund
Assignee: Jonas Kongslund
Fix For: 5.0.3
The following code snippet is from the [5.0.2 STM
Guide|http://docs.jboss.org/jbosstm/5.0.2.Final/guides/stm_guide/index.html].
{code:java}
public class ExampleInteger implements Atomic
{
@WriteLock
public int get () throws Exception
{
return state;
}
...
@ReadLock
public void incr (int value) throws Exception
{
state += value;
}
private int state;
}
{code}
The lock annotations on {{incr}} and {{get}} need to be swapped in order for the example
to be correct.
A pull request is available.