Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Error method or field is undefined for the type xxx
Error method or field is undefined for the type xxx [message #1219629] Thu, 05 December 2013 04:38 Go to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
This is probably more of an Eclipse IDE problem. I have only used eclipse with xtext so I'm posting this here.

I am getting an error "method or field is undefined for the type xxx". Even though, it is defined.

The Outline view only shows half the contents of the file, and does not show some of the methods. I also cannot do "Open Declaration" for the referenced methods.

This has happened before but if I add some minor changes and save the file, it goes away. Or if I do a clean rebuild of the project.

But, today, it does not seem to go away. Half of the methods in this file is not being detected by eclipse. Is there a way to fix this?

I have tried restarting eclipse, clean then rebuild, but still the problem persists.

[Updated on: Thu, 05 December 2013 04:49]

Report message to a moderator

Re: Error method or field is undefined for the type xxx [message #1219635 is a reply to message #1219629] Thu, 05 December 2013 06:08 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
Usually when that happened to me it was due to "Unexpected EOF" as the result of some parsing issue. Any useful error/warnings about the place where it stops working?
Re: Error method or field is undefined for the type xxx [message #1219637 is a reply to message #1219629] Thu, 05 December 2013 06:21 Go to previous message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Okay. I have fixed my own problem, and found the root cause.

I have these conditional statements
if (x > 1)
   setPrivate(true);
else
   setPrivate(false);


The semicolon causes everything to go crazy. Everything after this method is not shown. I'm using XTEND, and this type of code should be allowed, right?

It will work again if I remove the semicolon, and do this:
if (x > 1)
   setPrivate(true)
else
   setPrivate(false)

[Updated on: Thu, 05 December 2013 06:22]

Report message to a moderator

Previous Topic:DSL Formatter does not execute
Next Topic:Class cast exception while running workflow
Goto Forum:
  


Current Time: Thu Sep 26 08:45:11 GMT 2024

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

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

Back to the top