Community
Participate
Working Groups
Okay it will be hard to find I guess, but the following things happen, not every time, but they happen. Three interfaces, the Interface Hypothesis inherits from Learner & ListenerIF: [code] package test; import java.io.Serializable; public interface TesterIF { HypothesisIF.TstResult testHypothesis(); interface TstResult extends Serializable { public double getConfidence(); } } package test; import java.io.Serializable; public interface LearnerIf { HypothesisIF.TResult doTrainingStep() ; interface TResult extends Serializable { public String getProtocoll(); } } package test; public interface HypothesisIF extends LearnerIf, TesterIF { } [\code] After moving or rebuilding the "cannot be resolved to a type" error message shows up most of the time. In my other, more complicated project it never ever compiles correct. javac works. "idea" too. Probably something with the building order?
Oh, I forgot. Stdout says: Reason: java.lang.NullPointerException
I suspect its your classpath/project setup that could be causing the problem. Do you run any other builders, like an Ant builder? Do you generate additional source files?
Yes, there is an ant script, but I don't use it. Classes are also generated, but they are all there. It compiles correct. I figured out another interesting thing. If I refactor the classes and move them i.e. to a new package(test.test.test.test), the error occurs every time. Simply saving the files again resolves the error. In some cases the save trick doesn't work. Then the error message (cannot be resolved ...) jumps from TestIF to LearnerIf. In the more complex project this happens all the time and I can't compile. PS: My Simple example project has no external classes nor anything else. Only three interfaces. Best regards, Georg
I think I can reproduce it now. It's not the kind of code I would write, but I have to handle it. Is it possible to send the whole project? I try to copy and paste it here... Hopdefully no copy'n paste errors :-) [file] package test.test.test.test; public interface AHypothesisIF extends ALearnerIf, ATesterIF { } [/file] [file] package test.test.test.test; public interface BHypothesisIF extends BLearnerIf, BTesterIF { } [/file] [file] package test.test.test.test; import java.io.Serializable; public interface ALearnerIf { AHypothesisIF.TResult doTrainingStep(); interface TResult extends Serializable { public String getProtocoll(); } } [/file] [file] package test.test.test.test; import java.io.Serializable; public interface ATesterIF { AHypothesisIF.TstResult testHypothesis(); interface TstResult extends Serializable { public double getConfidence(); } } [/file] [file] package test.test.test.test; import java.io.Serializable; public interface BLearnerIf { BHypothesisIF.TResult doTrainingStep(); interface TResult extends Serializable { public String getProtocoll(); } } [/file] [file] package test.test.test.test; import java.io.Serializable; public interface BTesterIF { BHypothesisIF.TstResult testHypothesis(); interface TstResult extends Serializable { public double getConfidence(); } } [/file]
The testcase works fine. Did you try it in a new workspace? You can send the entire project if you want, but please try to build it in a new workspace first to make sure the problem is reproduceable.
Also do you have the full stack from the NPE - please check your .log file to see if its still there.
Please reopen when you have a reproduceable testcase.
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.