Community
Participate
Working Groups
Created attachment 169412 [details] mini project with problematic inter-type constructor declaration i have an aspect with an inter-type declaration, which looks like this: package de.wieger.sample; public aspect Person_ITD { public Person.new() { this(); // intentionally left blank } } When 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". 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#isARealProblem filters out a lot of problems like the one causing trouble when invoking "organize imports". The method conains an explicit snippet, dealing with the problematic syntactic construct: 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? I have attached an archive with a mini project containing the source code, which demonstrates the problem when invoking "organize imports" on the inter-type declaration. regards, Thomas Wieger
Fix is available in the latest dev build. Thanks for the sample project.
fixed.