Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369402

Summary: Many API tools EE description error false positives
Product: [Eclipse Project] PDE Reporter: Michael Rennie <Michael_Rennie>
Component: API ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, markus.kell.r, Olivier_Thomann, pwebster, remy.suen, thatnitind, tjwatson
Version: 3.8   
Target Milestone: 3.8 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Rennie CLA 2012-01-23 10:26:37 EST
code from HEAD

After checking out the HTML editor code to play around with adding JS breakpoints to the HTML editor, I noticed that there are 42 API tools errors on the the projects and one fatal error.

Fatal:
Group_label_Insertion cannot be resolved or is not a field	HTMLContentAssistPreferencePage.java	/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui	line 75	Java Problem

The bulk of the API tools errors are about using code that is not found in the project-specified EE. These are quite serious problems and should be fixed for M5
Comment 1 Nitin Dahyabhai CLA 2012-01-23 10:53:34 EST
Are you certain of this?  I see none of these issues when targeting a real 1.4.2 JDK, and wouldn't our builds have had compiler errors if so?  What are you using for your baseline?
Comment 2 Michael Rennie CLA 2012-01-23 11:21:16 EST
(In reply to comment #1)
> Are you certain of this?  I see none of these issues when targeting a real
> 1.4.2 JDK, and wouldn't our builds have had compiler errors if so?  What are
> you using for your baseline?

I am using 3.7.2 with WTP / JSDT / HTML editor installed in it as a baseline. The fatal error would given you a compile error, the API tools errors would not. I have cleaned my workspace many times thinking this was just a state problem with API tools, but the errors keep returning.
Comment 3 Michael Rennie CLA 2012-01-23 11:49:24 EST
Dug in to some of the errors like:

The type DocumentStyle referenced in org.eclipse.wst.html.core.internal.htmlcss.AbstractStyleSheetAdapter.styleUpdate(ICSSModel) is not defined in the bundle's required execution environment: J2SE-1.4	AbstractStyleSheetAdapter.java	/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss	line 211	API Usage Problem

and double-checked, DocumentStyle does indeed appear in a 1.4 EE.

I confirmed that my baseline is correct - I even reset it to be certain.

I'l shift this one over to PDE for comment. It looks like API tools is in a bad state.

Steps:
1. get org.eclipse.wst.html.core, org.eclipse.wst.html.ui, org.eclipse.wst.sse.core and org.eclipse.wst.sse.ui as source from the webtools cvs repo
2. create a baseline of 3.7.2 with JSDT, HTML editing, and XML editing tools installed
3. make sure all EE descriptions are installed
4. do a full build of the workspace (or clean+full build an existing workspace)
Comment 4 Michael Rennie CLA 2012-01-23 11:58:39 EST
Even weirder still, after resetting my target platform, restarting Eclipse and doing a clean + full build I now have a version error on jsdt.debug.core:

The minor version should be incremented in version 2.0.200, since new APIs have been added since version 2.0.100	MANIFEST.MF	/org.eclipse.wst.jsdt.debug.core/META-INF	line 5	Version Numbering Problem

but the version is already 2.0.200...
Comment 5 Michael Rennie CLA 2012-01-23 12:25:45 EST
The fatal error was because I needed to have wst.xml.ui as source in my workspace to resolve the field: XMLUIMessages.Group_label_Insertion

Nitin, it seems like a bad idea to reference an internal NLS string from another bundle.
Comment 6 Michael Rennie CLA 2012-01-23 12:34:00 EST
(In reply to comment #4)
 
> but the version is already 2.0.200...

And I forgot that we (API tools) no longer recommend what version to update to when API is changed. The version needs to be changed to 2.1.0 (http://wiki.eclipse.org/Version_Numbering#When_to_change_the_minor_segment).
Comment 7 Michael Rennie CLA 2012-01-24 10:09:19 EST
*** Bug 369513 has been marked as a duplicate of this bug. ***
Comment 8 Remy Suen CLA 2012-01-26 08:30:51 EST
Just hit this also. :/
Comment 9 Michael Rennie CLA 2012-01-26 12:33:56 EST
now I am getting a pile of these errors in the platform UI code:

The method CSSValue.getCssValueType() referenced in org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcherCSSHandler.applyCSSProperty(Control, String, CSSValue, String, CSSEngine) is not defined in the bundle's required execution environment: J2SE-1.5

PerspectiveSwitcherCSSHandler.java	/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher	line 36	API Usage Problem
Comment 10 Michael Rennie CLA 2012-01-27 12:51:36 EST
(In reply to comment #9)
> now I am getting a pile of these errors in the platform UI code:

Debugging this, I found something troubling. There are class files in the JRE that are API but do not appear in the API description, nor the API docs.

For example NodeIterator (one of the errors I have in my workspace). It appears in a 1.4.x JRE / SDK (<pathtojre>\jre\lib\xml.jar\org\w3c\dom\traversal\NodeIterator.class), but does not appear in the API docs (http://docs.oracle.com/javase/1.4.2/docs/api/) or the 1.4 EE description.
Comment 11 Michael Rennie CLA 2012-01-27 13:02:07 EST
(In reply to comment #10)
> (In reply to comment #9)

> (<pathtojre>\jre\lib\xml.jar\org\w3c\dom\traversal\NodeIterator.class)

That was the path into the IBM VM, for Oracle it is found here:

<pathtojre>\jre\lib\rt.jar\org\w3c\dom\traversal\NodeIterator.class
Comment 12 Olivier Thomann CLA 2012-01-27 13:07:48 EST
The EE descriptions are generated using the corresponding OSGi profiles. So it the package is not listed in the OSGi profile, it is removed at generation time from the EE description.
Comment 13 Michael Rennie CLA 2012-01-27 13:11:24 EST
Tom, do you know why the org\w3c\dom\traversal\ package is not in the 1.4 OSGi
profile?

If this is known / expected, then perhaps we need to add some sort of filtering to suppress errors like these.
Comment 14 Thomas Watson CLA 2012-01-27 13:22:09 EST
(In reply to comment #13)
> Tom, do you know why the org\w3c\dom\traversal\ package is not in the 1.4 OSGi
> profile?
> 
> If this is known / expected, then perhaps we need to add some sort of filtering
> to suppress errors like these.

See bug188304.

The Java 5 document lists the org.w3c.dom.traversal package:

http://docs.oracle.com/javase/1.5.0/docs/guide/plugin/dom/overview-summary.html

But the Java 4 document does not:

http://docs.oracle.com/javase/1.4.2/docs/guide/plugin/dom/overview-summary.html

We were unsure how much we could depend on these missing packages since they did not seem to be officially part of Java 4.
Comment 15 Michael Rennie CLA 2012-02-13 12:24:22 EST
Pushed updates to the 1.4 and 1.5 descriptions: http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=666b8e757e8a2bde22eb5faf5917da98d285a2ab
Comment 16 Michael Rennie CLA 2012-02-13 15:26:44 EST
pushed updates to the 1.6 / 1.7 descriptions:

http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=e618c7c2de97607f7c46e7431280a9269aaf8339
Comment 17 Michael Rennie CLA 2012-02-28 14:44:16 EST
All of the EE descriptions have been updated, I just forgot to close this bug. There was a JRE-specific issue (bug 372394), which has been fixed as well.