Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 232958 - The same API Problem is reported several in Problem View
Summary: The same API Problem is reported several in Problem View
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 RC2   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-20 09:32 EDT by David Audel CLA
Modified: 2008-05-21 19:41 EDT (History)
3 users (show)

See Also:
Michael_Rennie: review+
Olivier_Thomann: review+


Attachments
patch (9.26 KB, patch)
2008-05-21 12:08 EDT, Darin Wright CLA
no flags Details | Diff
patch (10.98 KB, patch)
2008-05-21 13:28 EDT, Darin Wright CLA
no flags Details | Diff
patch (25.45 KB, patch)
2008-05-21 15:59 EDT, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2008-05-20 09:32:06 EDT
build I20080519-2000
1) open a new workspace
2) checkout org.eclipse.jdt.core from dev.eclipse.org
3) add an API Baseline
4) do a full build
5) open org.eclipse.jdt.core.compiler.BuildContext.java
In the Problem View the type BuildContext.java has 6 problem:
BuildContext extends non-API type CompilationParticipantResult
BuildContext extends non-API type CompilationParticipantResult
BuildContext extends non-API type CompilationParticipantResult
Constructor for BuildContext with non-API parameter type SourceFile
Constructor for BuildContext with non-API parameter type SourceFile
Constructor for BuildContext with non-API parameter type SourceFile

In fact there is only 2 problems but each problem has three occurrences.

6) add a space in the editor of BuildContext.java
7) save and build
There is only 2 problems:
BuildContext extends non-API type CompilationParticipantResult
Constructor for BuildContext with non-API parameter type SourceFile

8) do a full build
There is the same 6 problems as before
Comment 1 Michael Rennie CLA 2008-05-20 16:51:45 EDT
The problem seems to be with the way we handle multiple source folders with overlapping output locations. For example the package which BuildContext appears in (o.e.j.c.compiler) appears in 3 locations, but they all share the same output location (/bin). The net effect is that we end up scanning all class files that appear in the final /bin/o/e/j/c/compiler folder N times, where N is the number of times the package appears in varying source folders.

It feels as though we should have some sort of 'i've been here' flag in our container visitor to prevent multiple visits to the same container.
Comment 2 Darin Wright CLA 2008-05-21 12:08:52 EDT
Created attachment 101306 [details]
patch

This patch creates a class file container per output location than per source folder. Avoids processing class files more than once when multiple source folders point to the same output location.

However, there's still a problem with SWT as it gets duplicates from its fragment... i.e. one class file from the project, and then one from the win32 fragment (since the classes are really packaged in the fragment's jar).
Comment 3 Darin Wright CLA 2008-05-21 13:28:18 EDT
Created attachment 101321 [details]
patch

This patch fixes the SWT case by not considering SWT fragments in the workspace profile.
Comment 4 Darin Wright CLA 2008-05-21 15:59:13 EDT
Created attachment 101368 [details]
patch

This patch adds an implementation of a class file container that is dynamic for a workspace folder. The problem with re-using "directory class file container" is that it does not update as packages are added/removed.
Comment 5 Darin Wright CLA 2008-05-21 16:00:46 EDT
Olivier, Mike, please reivew. Note that *without* this patch you will get many duplicate errors in the workspace for SWT API leaks.
Comment 6 Michael Rennie CLA 2008-05-21 17:21:57 EDT
looks good.
Comment 7 Olivier Thomann CLA 2008-05-21 19:37:32 EDT
+1 for 3.4RC2
Comment 8 Olivier Thomann CLA 2008-05-21 19:40:55 EDT
Released for 3.4RC2
Comment 9 Olivier Thomann CLA 2008-05-21 19:41:16 EDT
Verified.