On Tue, 05 Apr 2011 11:26:21 -0300, fnuzbit <fnuz...@googlemail.com> wrote:

HI All,

Hi!

private String foo;

public String getFoo(){
     return foo;
}
public void setFoo(String foo){
     this.foo = foo;
}

This is thread-safe as any access to the field itself (reading or writing) is replaced internally by a per-thread Map. In other words, it's perfectly thread-safe.

but it /is/ thread safe if I annotate it with the @Property instead:

@Property
private String foo;

AFAIK, using @Property generates the same bytecode as simple getters and setters.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to