Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369336

Summary: [Xtend] Parameter annotations getting lost during code generation
Product: [Tools] Xtend Reporter: Sven-Torben Janus <janus>
Component: CoreAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sven.efftinge
Version: 2.2.0Flags: sven.efftinge: juno+
Target Milestone: M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Sven-Torben Janus CLA 2012-01-22 13:08:13 EST
Build Identifier: 2.2.1 (on Eclipse Version: 3.7.1 Build id: M20110909-1335)

When annotating method parameters, the annotations are not transferred to the generated code.

As it can be seen in the example in "Steps to Reproduce" section, parameter annotations (@Named("foo") and  @Named("bar") are not present in the generated code while method annotations are transferred correctly (cf. @Inject).

Reproducible: Always

Steps to Reproduce:
1.
Create a new Xtend class with the following contents:

-- Xtend class --

package test
import com.google.inject.name.Named
import com.google.inject.Inject
class Test {
	@Inject
	new(@Named("foo") Object foo) {}
	@Inject
	def bar(@Named("bar") Object bar) ''''''
}


2.
Save and check generated source, which looks like this:

-- Java class --

package test;

import com.google.inject.Inject;
import org.eclipse.xtend2.lib.StringConcatenation;

@SuppressWarnings("all")
public class Test {
  @Inject
  public Test(final Object foo) {
  }
  
  @Inject
  public CharSequence bar(final Object bar) {
    StringConcatenation _builder = new StringConcatenation();
    return _builder;
  }
}
Comment 1 Sven Efftinge CLA 2012-01-31 05:39:07 EST
was fixed in M5
Comment 2 Karsten Thoms CLA 2017-09-19 17:30:33 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:41:48 EDT
Closing all bugs that were set to RESOLVED before Neon.0