views:

930

answers:

2

The error is this:

The method add(String, int) in the type DataNode is not applicable for the arguments (String, String)

However, in the DataNode class, I have a number of overloaded add() methods, including one that takes a String and an int and one that takes two Strings. It appears that Eclipse isn't "seeing" the right add() method.

I've tried things like refreshing the project and files and removing the method, saving the file, then adding it back. No matter what I've tried, the error persists.

Does anyone know the cause and how to correct it?

A: 

Forcing a compile with my Ant build script, some errors were revealed. When I refactored my package names, import statements were added to some files that imported nonexistent files (or at least what should have been nonexistent files, I need to check on that). For some reason, this generated the error that I was seeing. Removing the import statements corrected the problem.

Thomas Owens
+1  A: 

Try to clean to project direcly Project-Clean

I my case this is working... most of the time.

Markus Lausberg
+1 Actually, that's a good idea that I didn't try. I'm not sure if it would have helped me this time, but I know that it has helped fix other weird things in the past.
Thomas Owens