I have a package which I’ve been adding classes to, and compiling OK, for months.
I added a new interface into another package, and two implementations of it to THIS package. The if and the impls both compile OK.
I added another class that uses the if as the type of some vars, and instantiates instances of the two impls into some of these vars.
They are all in this package. The impls and if compile OK (if I direct javac to compile those classes individually). I COULDN’T compile the latest class - I got:
(fully qualified pacakge name)/(class name).java:104: cannot resolve symbol
symbol : class (impl from same package)
location: class (fqpn).(impl from same package)
gameData = new (impl from same package)();
Note that I didn’t get a “cannot resolve symbol” for the if itself, which lives in a different package; the main class is importing that package correctly - it’s just the classes in it’s own package that it couldn’t seem to find!
In the end, after diff’ing source files, I found a typo in the fqpn for the new class. Did javac say “this source file is being compiled from the wrong place”? No way. Am I going insane, or did it do this in earlier versions?
I’ve noticed in recent versions of java that javac seems more cryptic than I thought it used to be - there are one or two compile-time errors or warnings where (once I’ve worked out the ACTUAL problem - the message gives a completely misleading reason (or just doesn’t say at all)) it could give a much more meaningful message but doesn’t.