Bug 51943 - java editor marks false errors for default access interface
Summary: java editor marks false errors for default access interface
Status: RESOLVED DUPLICATE of bug 36032
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-13 05:31 EST by Lukas Vosahlik CLA
Modified: 2004-02-13 07:48 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Vosahlik CLA 2004-02-13 05:31:23 EST
The Java editor marks false errors when using an interface with default
(package) access. The errors are not shown in Tasks or Package Explorer and the
code can be compiled and run normally.

How to reproduce: create a project containing package cz.netkit.test and 3
files: SomethingFactory.java, SomethingImpl.java and TestBug.java. 

File content:

// SomethingFactory.java
package cz.netkit.test;

interface ISomething
{
}

public class SomethingFactory
{
  public static ISomething getIt()
  {
    return new SomethingImpl();
  }
}

// SomethingImpl.java
package cz.netkit.test;

public class SomethingImpl implements ISomething // MARKED FALSE ERROR
{
}

// TestBug.java
package cz.netkit.test;

public class TestBug
{
  public static void main(String[] args)
  {
    ISomething it = SomethingFactory.getIt(); // MARKED FALSE ERROR
  }
}
Comment 1 Philipe Mulet CLA 2004-02-13 07:18:58 EST
This error is an artifact which only occurs in editor while typing. As you 
observed, it goes away when compiling the code (though the editor still shows 
it).

It only occurs in presence of secondary types. The workaround is to define each 
type in its own file.
Comment 2 Philipe Mulet CLA 2004-02-13 07:48:20 EST

*** This bug has been marked as a duplicate of 36032 ***