| Summary: | Inner nested class does not compile | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Paul Loveridge <luggypm> | ||||
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||
| Status: | CLOSED MOVED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | loskutov, mistria, srikanth.sankaran | ||||
| Version: | 4.21 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 10 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Yep, still in 4.22 master. $ javac foo/bar/Inner*.java
foo/bar/InnerAbstactor.java:3: error: cannot find symbol
public abstract class InnerAbstactor<T extends ChildAbstractor> {
^
symbol: class ChildAbstractor
1 error
So it seems like this error is legal according to the compile spec; and Maven and NetBeans are managing to "hide" this error by some other strategy.
See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1069 - this can be tracked along with that ticket. |
Created attachment 287436 [details] Maven example porject The following code compiles in NetBeans and Maven but fails in Eclipe: package foo.bar; public abstract class InnerAbstactor<T extends ChildAbstractor> { public void doSomethingOuter() { } public abstract static class ChildAbstractor extends InnerParent { public void doSomethingInner() { } } } You can make this class compile properly by either adding the import: import foo.bar.InnerAbstractor.ChildAbstractor; or changing the class declaration to : public abstract class InnerAbstactor<T extends InnerAbstractor.ChildAbstractor> However this class compiles file in maven (example project attached).