Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 403881 - [1.8][formatter] Receiver parameter halts formatting
Summary: [1.8][formatter] Receiver parameter halts formatting
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Jesper Moller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 400830
  Show dependency tree
 
Reported: 2013-03-20 08:17 EDT by Srikanth Sankaran CLA
Modified: 2013-03-21 05:19 EDT (History)
0 users

See Also:


Attachments
Test and patch (6.48 KB, patch)
2013-03-20 21:49 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 Srikanth Sankaran CLA 2013-03-20 08:17:18 EDT
BETA_JAVA8: 

There is no effect seen while formatting this program:

// ---
public class X {
	void foo(@Marker X this) {}
	class Y {
		Y(@Marker X X.this) {}
		void foo(X.Y this) {}
	}
}

@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE)
@interface Marker {
	
}

This could be due to assumptions that argument name is an TokenNameIdentifier,
which is not true for receiver parameters.
Comment 1 Srikanth Sankaran CLA 2013-03-20 08:17:43 EDT
Jesper, thanks for following up.
Comment 2 Jesper Moller CLA 2013-03-20 21:49:20 EDT
Created attachment 228755 [details]
Test and patch

Great test example, I'd missed a few of those cases :-)

Initial analysis was part of it, but since the receiver is not an argument in the AST, it had to be handled separately.
Comment 3 Srikanth Sankaran CLA 2013-03-21 05:19:54 EDT
Patch looks good. Fix and tests released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=2abb5c60316a8a4cab92c4dd0598d9a27a87d40b

Thanks Jesper.