Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 407297 - [1.8][compiler] Control generation of parameter names by option (like 'javac -parameters')
Summary: [1.8][compiler] Control generation of parameter names by option (like 'javac ...
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 415846
  Show dependency tree
 
Reported: 2013-05-06 09:40 EDT by Jesper Moller CLA
Modified: 2014-05-07 12:05 EDT (History)
3 users (show)

See Also:
jarthana: review+


Attachments
Patch for -parameters option (16.49 KB, patch)
2013-07-05 06:33 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-05-06 09:40:24 EDT
Although not documented in the JEP, the current EA javac supports generation of parameter names by option '-options' in javac.
ECJ should follow this lead for now. There should be a distinct Java Code Generation option for this in the UI, too.
Comment 1 Jesper Moller CLA 2013-06-26 18:49:11 EDT
Actually, the javac option for parameters is '-parameters'.
Comment 2 Jesper Moller CLA 2013-07-05 06:33:18 EDT
Created attachment 233121 [details]
Patch for -parameters option

Patch available for review.
This is just standard boilerplate-like code.
Comment 3 Jesper Moller CLA 2013-07-07 05:44:11 EDT
Requesting pre-commit review for this pretty simple change.
Comment 4 Jay Arthanareeswaran CLA 2013-07-09 04:32:54 EDT
Haven't reviewed the patch fully, but did you mean to include the code to preserve the parameter information in code generation?
Comment 5 Jesper Moller CLA 2013-07-09 08:51:36 EDT
(In reply to comment #4)
> Haven't reviewed the patch fully, but did you mean to include the code to
> preserve the parameter information in code generation?

No, this is just the plumbing for the option. The codegen will come in bug 406982.
Comment 6 Jay Arthanareeswaran CLA 2013-07-09 10:28:12 EDT
Patch looks good - just couple of minor comments:

1. Some of the existing similar options use GENERATE and DO_NOT_GENERATE. Shouldn't this one use them too instead of ENABLED/DISABLED?

2. Consider replacing "from Java SE 8 and later" with something like 'target' or 'compliance' (not sure about this) to be consistent with other docs.
Comment 8 Srikanth Sankaran CLA 2013-08-26 04:01:34 EDT
(In reply to comment #0)
> Although not documented in the JEP, the current EA javac supports generation
> of parameter names by option '-options' in javac.
> ECJ should follow this lead for now. There should be a distinct Java Code
> Generation option for this in the UI, too.

Raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=415846 for the UI
portion of work.
Comment 9 Srikanth Sankaran CLA 2013-08-26 04:22:42 EDT
Minor follow up commit to dot some i's and cross some t's here:
http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=17d73264c709eb08acaa64b6fb890141e6700656
Comment 10 Markus Keller CLA 2014-05-07 12:05:14 EDT
Javadoc fix to acknowledge that the MethodParameters attribute not only contains name_index but also access_flags: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=57bd7f827fb4e26e2f4fcfb421451c18e4a1d09f