Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtend throwing error on override method
Xtend throwing error on override method [message #1403208] Tue, 22 July 2014 11:00
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
I have an interface called AbstractFactory.java.

public interface AbstractFactory {
 public ArrayList<TestStruct> getListOfStruct();
}


This interface is implemented in ExcelTester.xtend class.
class ExcelTester implements AbstractFactory {
 override getListOfStruct()
 {
     val a = new ArrayList<TestStruct>
     return a
 }
}


TestStruct is a class that contains list of variables.
class TestStruct
{
   @Property int iRow;
   @Property int iCol;
   @Property String sContents;
}


This code was able to compile but if I do a clean build, an error is thrown.
"The method getListOfStruct() : ArrayList<TestStruct> of type
ExcelTester must override a superclass method."
In order to fix this error, I just need to "touch" the file (add space anywhere and save the file).
I am already using the override keyword. Anyone have any idea how to make the error go away?

This should not happen during a clean build since there is no error on the code. This error only occurs if the return value of the method is an ArrayList.

Is there a limitation on using java interfaces with xtend?

[Updated on: Fri, 25 July 2014 05:28]

Report message to a moderator

Previous Topic:Recognizing identical parts
Next Topic:Xtend editor does not see methods generated from IncQuery patterns until restart
Goto Forum:
  


Current Time: Fri Sep 20 11:34:12 GMT 2024

Powered by FUDForum. Page generated in 0.03153 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top