Cannot resolve type, but F3 works to open declaration [message #519468] |
Mon, 08 March 2010 17:26  |
Eclipse User |
|
|
|
I'm experiencing an issue I have never seen before with Eclipse: I am constantly getting error icons in the Java editor for types that are both in the same exact package as the class I am using them from or for types that are in included packages. I can make this go away by doing a 'Clean' on the project in question, but it shows up again whenever I do anything like save the file. The perplexing part is that I can hit 'F3' on the type that cannot be resolved, and I am taken right to the class definition!
Concrete example:
Project: VotingEngine
Class com.example.voting.action.VotingAction:
public class VotingAction implements Voting {
}
Where "voting" is in the exact same package, I get an error on the use of Voting as the interface: "Voting cannot be resolved to a type".
I hit F3 on "Voting", and I am taken right to the interface.
There is another problem too, where I import com.example.db.voting.model.User, and use it in the class. This class is defined in the project "votingdb", which has been added to the "VotingEngine" project's build path, and I get the same "User cannot be resolved to a type" message, but hitting F3 on it takes me to the class definition.
Without fail, I can get rid of these errors by doing a "Clean" on the project, until I modify the file again and the errors show up.
Any ideas?
|
|
|
|
|
|
Re: Cannot resolve type, but F3 works to open declaration [message #519854 is a reply to message #519684] |
Wed, 10 March 2010 03:59   |
Eclipse User |
|
|
|
Il 09/03/2010 18.06, rnideffer@gmail.com ha scritto:
> I'm using a fairly recent build:
>
> Version: 3.5.1
> Build id: M20090917-0800
>
> Applying updates regularly.
So, I don't have any idea.
The only thing I can suggest is to do what I did in my case, to help JDT
developers to find and fix the bug.
Try to reduce your codebase more and more until you find the smallest
set of files that reproduce the problem. Then, if that is propietary
code, try to remove the implementations of the methods, one by one,
unless this makes the problem disappear. When you're reduced to a bunch
of files with no meaning at all, but that reproduce the problem, you can
open a bug against JDT and attach your project.
You may have a look at my case:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=239229
Anyway, try disabling javadoc diagnoses. If that fixes your problem,
maybe it's something like the problem I mentioned.
Mauro.
|
|
|
Re: Cannot resolve type, but F3 works to open declaration [message #520279 is a reply to message #519468] |
Thu, 11 March 2010 09:44   |
Eclipse User |
|
|
|
On 3/8/10 5:26 PM, rnideffer@gmail.com wrote:
> I'm experiencing an issue I have never seen before with Eclipse: I am
> constantly getting error icons in the Java editor for types that are
> both in the same exact package as the class I am using them from or for
> types that are in included packages. I can make this go away by doing a
> 'Clean' on the project in question, but it shows up again whenever I do
> anything like save the file. The perplexing part is that I can hit 'F3'
> on the type that cannot be resolved, and I am taken right to the class
> definition!
>
> Concrete example:
>
> Project: VotingEngine
> Class com.example.voting.action.VotingAction:
>
> public class VotingAction implements Voting {
>
> }
>
> Where "voting" is in the exact same package, I get an error on the use
> of Voting as the interface: "Voting cannot be resolved to a type".
>
> I hit F3 on "Voting", and I am taken right to the interface.
>
> There is another problem too, where I import
> com.example.db.voting.model.User, and use it in the class. This class is
> defined in the project "votingdb", which has been added to the
> "VotingEngine" project's build path, and I get the same "User cannot be
> resolved to a type" message, but hitting F3 on it takes me to the class
> definition.
>
> Without fail, I can get rid of these errors by doing a "Clean" on the
> project, until I modify the file again and the errors show up.
>
> Any ideas?
It would be helpful to see the projects' organization and what the build
path looks like.
Eric
|
|
|
Re: Cannot resolve type, but F3 works to open declaration [message #520327 is a reply to message #520279] |
Thu, 11 March 2010 17:48  |
Eclipse User |
|
|
|
Eric Rizzo wrote on Thu, 11 March 2010 09:44 |
It would be helpful to see the projects' organization and what the build
path looks like.
Eric
|
Hi Eric,
I have two projects, VotingEngine and votingdb.
votingdb:
src/
-- main
--java
-- test
--java
default output folder: votingdb/target/classes
no projects on the build path
VotingEngine:
src/
-- main
--java
-- test
--java
default output folder: VotingEngine/target/classes
required projects on the build path: votingdb
This is the same structure I've used in lots of other projects, but haven't seen this issue until now. Any other information that would help out?
|
|
|
Powered by
FUDForum. Page generated in 0.05035 seconds