Block and Expression Annotations
Ben Evans
benjamin.john.evans at gmail.com
Thu Feb 2 07:32:06 UTC 2017
Hi,
Please note:
a) Joe Darcy's comments on this on jdk9-dev (that this feature has
already been explicitly considered and rejected by the EG that
produced JSR 308)
b) This is probably the worst possible time to start looking at this -
we are in rampdown for JDK 9 and even if this feature was totally new
and a slam-dunk in terms of desirability (neither of which is true) it
would definitely not make JDK 9.
Not only that, but core JDK engineers that we would need the help &
support of are presumably completely focused on shipping JDK 9 & so
wouldn't have any time to help us.
In all honesty, I think the best thing that the community can do at
this stage is to focus on bug fixes & any documentation patches (which
I believe would still have a chance of making the cut for 9).
Sorry to be a bit negative, but there we are!
Thanks,
Ben
On Thu, Feb 2, 2017 at 6:50 AM, Mohan Radhakrishnan
<radhakrishnan.mohan at gmail.com> wrote:
> I can try. Read the paper and existing tests and start on my own. Is that
> right ?
>
> Mohan
>
> On 2 February 2017 at 04:44, Mani Sarkar <sadhak001 at gmail.com> wrote:
>
>> Great opportunity for everyone on this list to help Ivan out.
>>
>> Please spread the word into other communities.
>>
>> Cheers,
>> Mani
>>
>> ---------- Forwarded message ---------
>> From: Ivan Paterno <ivan.paterno.mailinglist at gmail.com>
>> Date: Wed, 1 Feb 2017 at 23:05
>> Subject: Block and Expression Annotations
>> To: <jdk9-dev at openjdk.java.net>
>>
>>
>>
>> Hi all,
>>
>> I'm working on a change to the compiler/reflection library to handle
>> Annotation on two new ElementType: EXPRESSION and BLOCK.
>>
>> Here are some basic examples to explain what i mean:
>>
>> First on EXPRESSION annotation
>>
>> import java.lang.annotation.ElementType;
>> import java.lang.annotation.Target;
>>
>> @Target(ElementType.EXPRESSION)
>> @interface Test {}
>>
>> public class SimpleExpression {
>>
>> private int field1;
>> private static int field2;
>> private int field3 = 0;
>>
>> public SimpleExpression() {
>> this.field1 = @Test() {1};
>> field2 = this.field1 + @Test() {2};
>> this.field3 = @Test() {this.field1 + @Test() {field2}};
>> }
>>
>> }
>>
>> And on BLOCK:
>>
>> import java.lang.annotation.ElementType;
>> import java.lang.annotation.Target;
>>
>> @Target(ElementType.BLOCK)
>> @interface Test {
>>
>> String someValue() default "";
>>
>> }
>>
>> public class WhileLoop {
>>
>> private int a;
>>
>> public WhileLoop(int c) {
>> @Test() {
>> while (c != 0) {
>> this.a += c;
>> c--;
>> }
>> }
>> }
>> }
>>
>>
>> There are very basic example but i have a lot of tests added to my local
>> repository. Obviusly i need to create many others to cover the various
>> possibilities.
>>
>> Anybody want to help me make these tests?
>>
>> If someone is interested in the paper about this features, this is the
>> link:
>>
>> Walter Cazzola and Edoardo Vacchi, @Java: Annotations in Freedom, in
>> Proceedings of 28th Annual ACM Symposium on Applied Computing (SAC'13),
>> Coimbra, Portugal, March 2013, ACM Press
>>
>>
>> Thanks,
>>
>> Ivan Paterno
>>
>> --
>> @theNeomatrix369 <http://twitter.com/theNeomatrix369>* | **Blog
>> <http://neomatrix369.wordpress.com/>** | *LJC Associate & LJC Advocate
>> (@adoptopenjdk & @adoptajsr programs)
>> *Meet-a-Project - *MutabilityDetector
>> <https://github.com/MutabilityDetector>* | **Bitbucket
>> <https://bitbucket.org/neomatrix369>* * | **Github
>> <https://github.com/neomatrix369>* * | **LinkedIn
>> <http://uk.linkedin.com/pub/mani-sarkar/71/a77/39b>*
>> *Come to Devoxx UK 2017:* http://www.devoxx.co.uk/
>>
>> *Don't chase success, rather aim for "Excellence", and success will come
>> chasing after you!*
>>
More information about the adoption-discuss
mailing list