Bug 126013 - Inheritance ? - > "cannot be resolved to a type"
Summary: Inheritance ? - > "cannot be resolved to a type"
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: All Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2006-02-01 10:08 EST by Georg Öttl CLA
Modified: 2009-08-30 02:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Öttl CLA 2006-02-01 10:08:01 EST
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?
Comment 1 Georg Öttl CLA 2006-02-01 10:11:42 EST
Oh, I forgot. Stdout says:

Reason:
java.lang.NullPointerException
Comment 2 Kent Johnson CLA 2006-02-01 12:37:17 EST
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?
Comment 3 Georg Öttl CLA 2006-02-02 03:43:17 EST
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
Comment 4 Georg Öttl CLA 2006-02-02 04:07:42 EST
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]
Comment 5 Kent Johnson CLA 2006-02-02 14:35:31 EST
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.
Comment 6 Kent Johnson CLA 2006-02-03 11:22:26 EST
Also do you have the full stack from the NPE - please check your .log file to see if its still there.
Comment 7 Kent Johnson CLA 2006-02-06 10:26:08 EST
Please reopen when you have a reproduceable testcase.
Comment 8 Denis Roy CLA 2009-08-30 02:06:25 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.