Community
Participate
Working Groups
Build Id: 4.2 I20111205-0805 Apologies if I'm missing something here, but I thought that, providing I had definitions for my various Executable Environments installed (Preferences > Plug-in Development > API Errors/Warnings), that those definitions were used to validate system library usage without needing a corresponding JRE to be installed. But this does not seem to be the case. In my situation, I had a plugin with BREE set to J2SE-1.5, but I only had a Java6 JDK. I was was inadvertently using Java6's String#isEmpty() with no errors, despite that my "Invalid references to execution environments" was set to an error. My expectation was based on Ankur Sharma's blog [1] Another major difference is that API Tooling does not need JRE/JDK. It checks the usage against the environment descriptions. The descriptions are just the environment API and thus occupy very less space. For example, the 1.5 JRE takes close to 50MB while the descriptions for the same takes less than 2 MB. And the brief discussion on bugs 213027 and 253693 makes no mention of requiring a matching JRE to be installed. Is this a regression? Or a deliberate change? I noticed the screenshots have changed since Ankur's blog entry which referenced "Invalid references to system libraries". I bring this up as although I was able to find and install a J2SE 1.5 JRE to enable the check, it was somewhat difficult to find and install (Apple only supports Java6 JVMs now). I don't think I could find a working 1.4 JVM, let alone a 1.3 JVM if that was required. And JDT's Installed JREs dialog is rather unforgiving if the JRE directory layout doesn't meet its expectations. [1] http://blog.ankursharma.org/2009/07/system-library-validation_17.html
I can reproduce the behaviour, both 1.5 and 1.6 code is not being reported as an error even when the JDT EE and BREE are set to 1.4 and the various EE fragments are installed.
I'll try to take a look later today or tomorrow.
I tried and I don't reproduce. I'll attach a screenshot.
Created attachment 207993 [details] Problem is detected Can you contact me to find out what could be wrong with your environment?
Brian, how did you set up the api tooling nature of your project ? Can you check the .project file to make sure it has the right builder and nature? If not, try to run "Plug-in Tools>API Tools Setup", and run it on your project.
Trying this on my linux machine and the problems are reported fine. Brian, can you please check that your project has both the API Tools nature and builder. We are experiencing a problem on Win7 where the checkbox on the new project creation wizard to enable API tools isn't working. I will be opening a bug against SWT for it.
After more investigation, it looks like the problem comes from the way the updateData() is called. The check for isVisible() doesn't work when the wizard is closed on the next page (the one that sets the template).
The fix is to replace: data.setEnableAPITooling(fApiAnalysisButton.isVisible() && fApiAnalysisButton.getSelection()); with: data.setEnableAPITooling(fApiAnalysisButton.isEnabled() && fApiAnalysisButton.getSelection());
Pushed the fix to master and integration. Mike, please verify. http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=eaadd43b9efd004def95375670d746dd90a97401
+1 the fix works as advertised.
Thanks for the quick resolution! (In reply to comment #5) > Brian, how did you set up the api tooling nature of your project ? > Can you check the .project file to make sure it has the right builder and > nature? > If not, try to run "Plug-in Tools>API Tools Setup", and run it on your project. I wasn't aware that the bundles needed to have the API tooling analysis nature (nor were some other Platform UI developers). Would it make sense to relax this and simply require the PDE nature for the system-library checking? So that the API tooling nature would be for the API compat checking?
(In reply to comment #11) > I wasn't aware that the bundles needed to have the API tooling analysis nature > (nor were some other Platform UI developers). Would it make sense to relax > this and simply require the PDE nature for the system-library checking? So > that the API tooling nature would be for the API compat checking? Perhaps Olivier can confirm, but I think the builder short circuits if the nature isn't found to improve performance. The feature is provided by API Tools and the options controlling it are found on the API Errors/Warnings preference page.
(In reply to comment #11) > Thanks for the quick resolution! > > I wasn't aware that the bundles needed to have the API tooling analysis nature > (nor were some other Platform UI developers). Yes, you must add the nature / build spec to the project, otherwise API tools completely ignores your project. We have a handy setup wizard you can run from the popup menu for a project: Plug-in Tools > API Tools Setup... > Would it make sense to relax > this and simply require the PDE nature for the system-library checking? So > that the API tooling nature would be for the API compat checking? The nature and the build spec are tied together - you need a nature to define a build spec (I believe) and since the sys-lib checking is done with the API tools builder, it would be a tonne of work to split it out to only work with the PDE builder.