Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Where does JDT set the errors with the arguments when a compilation fails
Where does JDT set the errors with the arguments when a compilation fails [message #786043] Sun, 29 January 2012 23:15 Go to next message
Fabrice Marcelin is currently offline Fabrice MarcelinFriend
Messages: 15
Registered: February 2011
Location: USA
Junior Member

Hello there,
My question concerns the whole compilation process in eclipse. I'm hoping that anyone could shed some light on the subject. Correct me if I'm wrong, when eclipse is compiling a project or a file it goes to those steps:
EclipseCompiler that implements JavaCompiler calls EclipseCompilerImpl, which extends Main. The latter calls the function beginCompilation in the Compiler class that implements ITypeRequestor and ProblemSeverities.
Now my primarily concern is about when the compiler finds an error. It seems like the compiler calls AbortCompilation that extends RuntineException but I am not sure where the compiler stores the error arguments, messages and what not.
Also, for the problemID: 67108964, with the message: "The method XXX is undefined for the type YYY" the getArguments() method only returns the type of the variable. Is there a way to get the name of the variable?

Thanks.
Re: Where does JDT set the errors with the arguments when a compilation fails [message #786328 is a reply to message #786043] Mon, 30 January 2012 09:20 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
From the IDE, EclipseCompiler is not the main entry point but JavaBuilder#build() is the one which triggers the build. This ends up calling org.eclipse.jdt.internal.compiler.Compiler.compile(ICompilationUnit[]). For any error or warning, the compiler creates a Problem which eventually becomes the Eclipse Marker.

ProblemReporter contains the information that the compiler puts for different errors. There need not be any variable for this kind of message and even so do you see the need for it? As of now, the name of the variable is not being stored in the problem structure. However, as the source positions of the error is also part of the Problem message, one can find out the variable name.

Re: Where does JDT set the errors with the arguments when a compilation fails [message #789205 is a reply to message #786328] Thu, 02 February 2012 18:29 Go to previous messageGo to next message
Fabrice Marcelin is currently offline Fabrice MarcelinFriend
Messages: 15
Registered: February 2011
Location: USA
Junior Member

@Satyam Thanks for your reply. As for your question, yes I do need it and I think I will consider taking your advice. However, I've been searching online and I couldn't find any example as to how to traverse the AST given its getSourceStart(). Would you be able to explain me or provide any useful link on that subject?
Thanks
Re: Where does JDT set the errors with the arguments when a compilation fails [message #789719 is a reply to message #789205] Fri, 03 February 2012 10:15 Go to previous message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
org.eclipse.jdt.core.dom.NodeFinder should help you.
Previous Topic:Perspecive without any toolbar buttons
Next Topic:Issue with console
Goto Forum:
  


Current Time: Fri Apr 26 17:36:46 GMT 2024

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

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

Back to the top