| Thread overview | |||||
|---|---|---|---|---|---|
|
September 11, 2008 Java adds concurrency annotations | ||||
|---|---|---|---|---|
| ||||
The folks at Sun are adding standard annotations to Java 7 for security, concurrency, precondiitons and nullability, among others: http://today.java.net/pub/a/today/2008/09/11/jsr-305-annotations.html I wonder how these will play out in the real world. I'm especially interested in the @Immutable annotation since Java's pass-by-reference implementation makes immutability very difficult to implement. Thanks again, Walter, for the transitive const paradigm. (Although I still contend that you got the keyword wrong: it should be "immutable" -- just like Java!!) Paul | ||||
September 11, 2008 Re: Java adds concurrency annotations | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Paul D. Anderson | Paul D. Anderson wrote: > The folks at Sun are adding standard annotations to Java 7 for > security, concurrency, precondiitons and nullability, among others: > > http://today.java.net/pub/a/today/2008/09/11/jsr-305-annotations.html > > > I wonder how these will play out in the real world. I'm especially > interested in the @Immutable annotation since Java's > pass-by-reference implementation makes immutability very difficult to > implement. My reading of the article suggests that it is a compile time only thing. There's no mention of transitivity, but the description implies it isn't transitive. > Thanks again, Walter, for the transitive const paradigm. (Although I > still contend that you got the keyword wrong: it should be > "immutable" -- just like Java!!) > > Paul | |||
September 11, 2008 Re: Java adds concurrency annotations | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > My reading of the article suggests that it is a compile time only thing. There's no mention of transitivity, but the description implies it isn't transitive. It's not strictly compile-time. The annotations are retained as metadata in the bytecode, so they could be used at runtime, but the main point of retention is for static analysis of bytecodes. The @Immutable annotation is definitely not transitive. Off the top fo my head, the idea of transitive const seems to rely on "ownership" of data. And since java deliberately eschews the idea of data ownership, I doubt if it would be possible to implement transitive const. Also, the @Immutble annotation only applies to data, and there doesn't seem to be any annotation for @ThisMethodDoesntModifyItsArgs. --benji | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply