[jbossts-issues] [JBoss JIRA] (JBTM-2201) Bug in STM example

Jonas Kongslund (JIRA) issues at jboss.org
Thu Jun 19 17:32:24 EDT 2014


Jonas Kongslund created JBTM-2201:
-------------------------------------

             Summary: 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: Mark Little


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.



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jbossts-issues mailing list