Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 403410 - Modifiers should be rejected on receiver parameters
Summary: Modifiers should be rejected on receiver parameters
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 420125 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-03-15 00:32 EDT by Jay Arthanareeswaran CLA
Modified: 2013-11-06 01:37 EST (History)
1 user (show)

See Also:
srikanth_sankaran: review+


Attachments
Proposed fix (7.42 KB, patch)
2013-03-15 02:53 EDT, Jay Arthanareeswaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jay Arthanareeswaran CLA 2013-03-15 00:32:51 EDT
The latest spec doesn't allow modifiers on explicit 'this' parameters:

FormalParameterOrReceiverDecls:
Type [Identifier .] this [, FormalParameterDecls]
FormalParameterDecls

The javac allows final but rejects static. But as per the spec, all modifiers should be rejected on receiver params.
Comment 1 Jay Arthanareeswaran CLA 2013-03-15 02:53:16 EDT
Created attachment 228458 [details]
Proposed fix

Just a note about having the modifier check for receiver in AbstractMethodDeclaration.resolveReceiver() - The only reason for doing this is to get the correct range for error reporting.
Comment 3 Srikanth Sankaran CLA 2013-03-15 03:53:49 EDT
Please run all Java 8 tests before posting a patch. CompilerInvocationTests
was missing a change and failing. Fixed here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=1c1d418ad63ddf8e8c36736ccc520ce9790f3c20
Comment 4 Srikanth Sankaran CLA 2013-11-06 01:37:29 EST
*** Bug 420125 has been marked as a duplicate of this bug. ***