Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » BUG? Organize Imports on Intertype-Declaration complains "Compilation unit has parse errors&quo
BUG? Organize Imports on Intertype-Declaration complains "Compilation unit has parse errors&quo [message #534689] Wed, 19 May 2010 22:28 Go to next message
Thomas Wieger is currently offline Thomas WiegerFriend
Messages: 4
Registered: July 2009
Junior Member
i have an aspect with an inter-type declaration, which looks like this:


package de.wieger.domaindriven.sample;

<lots of unused imports>

privileged aspect Person_ITD {
Person.new(PersonBuilder pBuilder) {
this();
}
}


If i invoke "Organize Imports" in eclipse, i get the following error:
"Compilation unit has parse errors: Constructor call must be the first statement in a constructor".
I'm using AJDT 2.0.2.

It looks like this is a bug. Is anybody else experiencing this?
Should i file a bug for this in bugzilla?

From my prospective, it seems like the method AjOrganizeImportsOperation#collectReferences is a little bit too strict about what should be considered as a relevant parsing error.
I have seen, that AjCompilationUnitProblemFinder filters a lot of problems like the one causing trouble when invoking "organize imports" out.
There is an explicit snippet, dealing with my problem:

if (numArgs == 0 && id == IProblem.InvalidExplicitConstructorCall) {
// ITD constructor making explicit this() call.
// lots of potential for false negatives
return false;
}


Maybe this could indicate the direction for a fix?
What do you think?

regards,

Thomas
Re: BUG? Organize Imports on Intertype-Declaration complains "Compilation unit has parse errors [message #534694 is a reply to message #534689] Wed, 19 May 2010 23:39 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 369
Registered: July 2009
Senior Member
Hi,

This is most definitely a bug.

I think the solution is, as you say to use AJCompilationUnitProblemFinder to determine if this is a problem that we should be concerned about.

Could you please raise a bug for this? I expect that a fix is imminent.

Thanks for proposing a solution.
Re: BUG? Organize Imports on Intertype-Declaration complains "Compilation unit has parse errors [message #534968 is a reply to message #534694] Thu, 20 May 2010 20:17 Go to previous messageGo to next message
Thomas Wieger is currently offline Thomas WiegerFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

i have raised bug 313808 for this issue (https://bugs.eclipse.org/bugs/show_bug.cgi?id=313808).

Best regards,

Thomas
Re: BUG? Organize Imports on Intertype-Declaration complains "Compilation unit has parse errors [message #534997 is a reply to message #534968] Thu, 20 May 2010 23:50 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 369
Registered: July 2009
Senior Member
Thanks.
Previous Topic:How to call inherited methods with return values?
Next Topic:BUG? Organize Imports on Intertype-Declaration complains "Compilation unit has parse errors&
Goto Forum:
  


Current Time: Tue Dec 23 05:21:20 GMT 2014

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

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