Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 412150 - [1.8] [compiler] Enable reflected parameter names during annotation processing
Summary: [1.8] [compiler] Enable reflected parameter names during annotation processing
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: BETA J8   Edit
Assignee: Jesper Moller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 406966
  Show dependency tree
 
Reported: 2013-07-02 18:37 EDT by Jesper Moller CLA
Modified: 2013-08-30 01:07 EDT (History)
2 users (show)

See Also:
srikanth_sankaran: review+


Attachments
Patch for this functionality (contains binary) (36.74 KB, patch)
2013-08-28 03:44 EDT, Jesper Moller CLA
no flags Details | Diff
JDT part of the patch (5.94 KB, patch)
2013-08-28 05:22 EDT, Jesper Moller CLA
no flags Details | Diff
APT part of the patch (26.89 KB, patch)
2013-08-28 05:36 EDT, Jesper Moller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Moller CLA 2013-07-02 18:37:38 EDT
If the annotation processing supports it, enable accessing the decoded method parameter names during processing of annotations.
Comment 1 Jesper Moller CLA 2013-08-28 03:44:48 EDT
Created attachment 234832 [details]
Patch for this functionality (contains binary)

I haven't worked with the APT stuff before, so the testing strategy is a 'best effort'.
I've built the annotations.jar as per the jardesc.

The patch is not final, since the VariableElement.getModifiers() method doesn't return the final modifier from MethodParameters yet.

Note how ExecutableElementImpl contained filtering of synthetic arguments for enum constructors, but it effectively duplicated the same kind of filtering in BinaryTypeBinding, so I've removed it.
Comment 2 Jesper Moller CLA 2013-08-28 03:49:17 EDT
Requesting review of implementation and testing strategy.

I figured I could test it in org.eclipse.jdt.compiler.apt.tests.ModelTests as well, but I couldn't quite figure out how the existing tests worked.
Comment 3 Srikanth Sankaran CLA 2013-08-28 04:00:02 EDT
Jesper, sorry for the housekeeping burden, could you split this patch into
two please, one for the JDT/Core, for which I'll be reviewer and Jay will be
the reviewer and committer for APT (I don't think either of us have commit
right for APT)

Jay, the APT portion will have to go through CQ approval process. Can be
taken up after review.

We also need to raise a ER against APT and move the relevant portions of
the patch there.
Comment 4 Jesper Moller CLA 2013-08-28 05:22:42 EDT
Created attachment 234834 [details]
JDT part of the patch

This is the JDT part of the changes, to support carrying the methodparameters over to the MethodBinding.
Comment 5 Jesper Moller CLA 2013-08-28 05:36:20 EDT
Created attachment 234836 [details]
APT part of the patch

The APT part of the patch, mostly tests. This is the part which should go to CQ review, since it's well over 250 lines.

There'll be a few more changes coming when I get to the finishing touches, but it'll be <250 lines -- or you could wait, if you prefer.
Comment 6 Jesper Moller CLA 2013-08-28 05:38:53 EDT
(In reply to comment #3)
> Jesper, sorry for the housekeeping burden, could you split this patch into
> two please, one for the JDT/Core, for which I'll be reviewer and Jay will be
> the reviewer and committer for APT (I don't think either of us have commit
> right for APT)

Done. Will we need to split the bug as well?

It's a pity I couldn't finish this entirely (I didn't notice that APT was a separate component), but I'm going to continue on JEP120 while the housekeeping is in progress.
Comment 7 Srikanth Sankaran CLA 2013-08-28 06:25:44 EDT
Patch looks good, In BTB, please extract the 4 uses of argumentNames.length
into a local, release and resolve this one, Thanks!

Yes, I'll raise a separate bug for APT shortly.
Comment 8 Srikanth Sankaran CLA 2013-08-28 06:34:11 EDT
(In reply to comment #7)

> Yes, I'll raise a separate bug for APT shortly.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=416027, Thanks.
Comment 9 Srikanth Sankaran CLA 2013-08-28 06:38:18 EDT
BTW, I noticed that your name shows up "Jesper Steen Moeller" in a bunch 
of copyright text and as "Jesper Steen Moller" in others. Is this a valid
alternate spelling or a typo perpetuated by copy + paste ? 

(Also some of us thought you pronounced your name with a starting "Y" sound
during our phone meeting. So is that the right pronunciation ?)
Comment 10 Srikanth Sankaran CLA 2013-08-28 06:51:37 EDT
(In reply to comment #6)

> It's a pity I couldn't finish this entirely (I didn't notice that APT was a
> separate component), but I'm going to continue on JEP120 while the
> housekeeping is in progress.

APT work may not need CQ review - I'll check with Dani.

Before you plunge into JEP 120, can we close the loose ends in 118 JDT/Core work
so we can declare done (APT work can happen in due course)
Comment 11 Srikanth Sankaran CLA 2013-08-30 01:07:14 EDT
(In reply to comment #7)
> Patch looks good, In BTB, please extract the 4 uses of argumentNames.length
> into a local, release and resolve this one, Thanks!

I went ahead and made this change and released it here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=1ab5591c67cb695048e1591e0a714342e9b9c85b

> APT work may not need CQ review - I'll check with Dani.

It does not require, but it is better to engage Jay when you are
fully done with the finishing touches.