Bug 77272 - [builder] Delta compilation fails to notice errors when removing an interface
Summary: [builder] Delta compilation fails to notice errors when removing an interface
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-29 07:26 EDT by John Hendrikx CLA
Modified: 2004-12-14 10:59 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 John Hendrikx CLA 2004-10-29 07:26:03 EDT
The summary doesn't quite do it justice, so I will try to explain better.

The problem occurs when I change an Interface to no longer extend another
Interface.  In this case the Car interface is changed to no longer extend the
Vehicle interface.  What happens is that methods returning an implementation of
the Car interface as a Vehicle do not show up as errors.  Example:

I have 4 java files, all in the same package:

Vehicle.java:

public interface Vehicle {
}

Car.java:

public interface Car extends Vehicle {
}

CarImpl.java:

public CarImpl implements Car {
}

Test.java:

public class Test {
    public Vehicle createVehicle() {
        return new CarImpl();
    }
}

Now remove the "extends Vehicle" line from the Car interface, and save it.  You
will get no errors in class Test.  When you open the class, you do see the
error, and when you modify/save it is also pops in the problems list.

I first noticed this problem in a large project where I removed an interface
from the extends clause of another interface.  I got dozens of errors, fixed
them all, but some errors never showed up.  Only after a full rebuild did they show.

The example above is the smallest example that reproduces this problem (AFAIK).
Comment 1 Philipe Mulet CLA 2004-11-22 12:27:29 EST
Suspect the following may have been also broken before we optimized out member
receiver hierarchies:

    public Vehicle createVehicle(CarImpl car) {
        return car;
    }
Comment 2 Kent Johnson CLA 2004-11-24 12:12:09 EST
Added DependencyTests.testInterfaceDeleting()
Comment 3 Olivier Thomann CLA 2004-12-14 10:59:58 EST
Verified in 200412140800.