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

Bug 333866

Summary: Warning/Error for missing API Tools EE description
Product: [Eclipse Project] PDE Reporter: Markus Keller <markus.kell.r>
Component: API ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, daniel_megert
Version: 3.7   
Target Milestone: 3.8 M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
first hack
none
fix none

Description Markus Keller CLA 2011-01-10 09:04:48 EST
N20110109-2000

Set the option "Preferences > API Errors/Warnings > API Use > General > Invalid references to system libraries" to Warning or Error.

=> When no environment descriptions are installed and a project would need the descriptions in order to flag bad references (because there's no strictly compatible JRE for the execution environment available), then API Tools should show a warning/error on the project.

Background:
Currently, some of our projects have the option "Preferences > Java Compiler > Building > No strictly compatible JRE for execution environment found" set to Error to make sure nobody accidentally writes new code against a newer JRE than allowed.

This was OK as long as older JREs were still available, but nowadays, it's difficult (or e.g. on the Mac even impossible) to get a 1.4 JRE install to compile against. We should eventually set the JDT/Core option to Ignore and rely on the API Tools option, but we currently can't do that because the environment descriptions are not installed by default and the API Tools compiler silently skips that problem.

An alternative to this solution would be to make it easier to add a dummy EE install for every EE. In the rt CVS repository, /org.eclipse.osgi/osgi/ contains dummy *.ee files for the OSGI-Minimum and CDC/Foundation-1.1 environments, but similar files are not available for other EEs (e.g. J2SE-1.4).
Comment 1 Dani Megert CLA 2011-08-04 09:42:57 EDT
This is a major flaw and can lead to (PDE) build or runtime issues.
Comment 2 Michael Rennie CLA 2011-08-04 12:44:54 EDT
Created attachment 200937 [details]
first hack

The patch provides a builder hook for checking if there are no EE descriptions installed and reporting an error on the project as desired.

Also fixes up a performance issue where the EE description problem detector would get added to the list of detectors to run during a build regardless of there being any EE descriptions installed.
Comment 3 Michael Rennie CLA 2011-08-08 13:28:14 EDT
Created attachment 201096 [details]
fix

This patch provides:
1. the builder hook to check if no descriptions are installed
2. a preference on the Errors / Warnings page the set the severity of the new problem
3. a problem quick-fix to open the pref page to re-configure the descriptions
Comment 4 Michael Rennie CLA 2011-08-08 15:37:53 EDT
Applied latest patch to HEAD.

Curtis et. al. please verify.
Comment 5 Curtis Windatt CLA 2011-08-08 16:56:10 EDT
Verified. Some of the messages were updated. Also see bug 354183
Comment 6 Dani Megert CLA 2011-08-10 04:21:39 EDT
(In reply to comment #4)
> Applied latest patch to HEAD.
> 
> Curtis et. al. please verify.

I tried to verify it in I20110809-0800 - no luck. I then looked at the tag of the patched files in HEAD which is 'v20110809', so I tried the I-build again - still no luck. I then looked in more detail into the map file and found out that 'v20110809' was used after I20110809-0800 was built. This is very misleading and caused me to waste my time. Please use more precise tags and of course try to catch the train before it leaves the station ;-).

I now verified in HEAD that the fix works for me.
Comment 7 Curtis Windatt CLA 2011-08-10 09:08:42 EDT
(In reply to comment #6)

> I tried to verify it in I20110809-0800 - no luck. I then looked at the tag of
> the patched files in HEAD which is 'v20110809', so I tried the I-build again -
> still no luck. I then looked in more detail into the map file and found out
> that 'v20110809' was used after I20110809-0800 was built. This is very
> misleading and caused me to waste my time. Please use more precise tags and of
> course try to catch the train before it leaves the station ;-).

My fault Dani, sorry.