Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 381209 - [@Data] generated methods should only be skipped if signature matches completely
Summary: [@Data] generated methods should only be skipped if signature matches completely
Status: VERIFIED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: v2.7
Keywords:
Depends on: 437498 437501 437508 437509
Blocks:
  Show dependency tree
 
Reported: 2012-05-31 10:39 EDT by Moritz Eysholdt CLA
Modified: 2014-08-28 07:53 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2012-05-31 10:39:13 EDT
Example:


--------- Xtend -------------
@Data
class Foo {
	String foo
	
	def hashCode(int foo) { }
	def toString(String xxx) {}
	def equals(Object o1, Object o2) {}
	def getFoo(String x) {}
	def setFoo(String x, String y) {}
}
-----------------------------


------------ generated Java ------------

package bar;

import org.eclipse.xtend.lib.Data;

@Data
@SuppressWarnings("all")
public class Foo {
  private final String _foo;
  
  public Object hashCode(final int foo) {
    return null;
  }
  
  public Object toString(final String xxx) {
    return null;
  }
  
  public Object equals(final Object o1, final Object o2) {
    return null;
  }
  
  public Object getFoo(final String x) {
    return null;
  }
  
  public Object setFoo(final String x, final String y) {
    return null;
  }
  
  public Foo(final String foo) {
    super();
    this._foo = foo;
  }
}
-------------------------------

Expected behavior: Non of the auto-generated methods should be suppressed by the member methods from the Xtend file since their signatures doesn't match completely.
Comment 1 Stefan Oehme CLA 2014-06-26 08:31:22 EDT
Fixed in the new AA-based implementation
Comment 2 Jan Koehnlein CLA 2014-08-28 07:53:00 EDT
Fixed in both @Data annotations.