Eclipse Mars.2 problem resolving type [message #1733996] |
Thu, 02 June 2016 19:13 |
Kevin Mitchell Messages: 2 Registered: June 2016 |
Junior Member |
|
|
First some background:
I'm helping maintain a large project with about 2,398 source files. We get source drops from our upstream partner who apparently uses Ant and Eclipse, and we use Maven and M2Eclipse with Eclipse.
We've got a new code drop that has some added and modified files, and I'm testing building it in our environment.
Sometimes, the IDE can't resolve the type on some of the classes. I get messages like <Classname> cannot be resolved to a type.
The classes that aren't resolved happen to not be in files named after the class, and there are also almost-identical classes with the same names in an adjacent package. These classes, and their state of disorganization, are not new; we've been successfully developing this product with Eclipse for over 18 months.
Furthermore, it's intermittent. Some minor changes to other files may make the errors go away, but using the Clean... menu item and a rebuild causes the errors to come back.
I can also observe the following strange results:
- Choose the missing type, do a Quick Fix to add the import for that type, and the IDE doesn't add the import (the unresolved type is in the same package). The option to fix things by importing is not always present.
- Add the import manually, and it fixes the problem.
- Organize Imports removes the redundant import of a class in the same package, and then the errors reappear.
- Going outside the IDE and manually changing the packages around by transposing letters in a two-level-up directory name, and using Perl to change all the package paths in the source, also fixes the problem. In other words, the problem is sensitive to the name we're using for the packages.
Fails with:
- Mars.2 IDE
- Latest snapshot IDE
The source seems to be well-formed, at least in the sense that it builds fine with:
- Oracle JDK 1.7 compiler via Maven
- ecj-4.5.2 in batch mode, using a build.xml exported from the IDE, and the settings file from the IDE (strangely enough)
- IntelliJ IDEA
Problem seems to be consistent on Mac/Windows/Linux, and I've tried new workspaces, clean installs of Eclipse, deleting global Eclipse settings.
My experiments tell me that the problem seems to be isolated to the incremental compilation that happens in the IDE. That it's so sensitive to how things are named makes me wonder if there's some kind of hash collision in a cache or something.
Any ideas/suggestions? Is there a way I can gather debugging information from the JDT?
I could even attempt a look into the JDT source code if anybody can suggest what part might be involved.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05188 seconds