Community
Participate
Working Groups
3.7 + http://wiki.eclipse.org/JDT/Eclipse_Java_7_Support_%28BETA%29 Needs to be investigated as maybe the Java 7 support broke it. Steps: 1. start new workspace with 1.5 JRE 2. install Environment Descriptions in Eclipse and set it to 'Error'. I installed them from: http://download.eclipse.org/eclipse/updates/3.7 3. paste this into Package Explorer: public void test() { StringBuilder b= new StringBuilder(); b.toString(); } 4. convert the project to a PDE project 5. add this to the manifest: Bundle-RequiredExecutionEnvironment: J2SE-1.4 ==> no error reported (see comment below) 6. change the compliance of the project to 1.5 but leave the JRE as is ==> no error reported I might even argue that the error should already be reported after step 5, as the diagnosis comes from PDE and hence should give more weight to the manifest entry than the project compliance. But once the compliance is set to 1.4 the error should definitely appear.
I'll take a look.
If in step 5a, you convert the project to use API Tools then errors are properly detected. Converting to a PDE project doesn't make it API Tools aware. Maybe we should add an extra checkbox in the wizard to convert to a PDE project identical to the check when creating a new PDE project. I would close as INVALID.
(In reply to comment #2) > If in step 5a, you convert the project to use API Tools then errors are > properly detected. Converting to a PDE project doesn't make it API Tools aware. Indeed. Verified that it works when doing said step. > Maybe we should add an extra checkbox in the wizard to convert to a PDE project > identical to the check when creating a new PDE project. Definitely. When I see a "normal" Java project I can only convert it to a Plug-in Project. After doing that I would expect that all preferences under the 'Plug-in Development' take effect. Note that I also looked on the project property page but no luck to enable API Tools there either. We should 1. improve the wizard as you suggested 2. add a checkbox to the 'Plug-in Development' project property page [ ] Enable API Tools. This will also easily allow to see whether API Tools is enabled for a project, which is currently not the case. It would also allow to easily disable this again, which again, is currently not possible via UI as 'API Tools Setup...' is a one way action.
Move to PDE/UI
(In reply to comment #3) > 2. add a checkbox to the 'Plug-in Development' project property page > [ ] Enable API Tools. > This will also easily allow to see whether API Tools is enabled for a > project, > which is currently not the case. It would also allow to easily disable this > again, which again, is currently not possible via UI as 'API Tools Setup...' > is a one way action. I like this idea. We could even consider getting rid of the menu action altogether in this case. We would also have a decent fix for bug 221913 at the same time.
(In reply to comment #5) > I like this idea. We could even consider getting rid of the menu action > altogether in this case. We would also have a decent fix for bug 221913 at the > same time. Yes, if we go ahead with this idea inside the PDE property page, then we should get rid of the menu.
Created attachment 203458 [details] Fix to add option to conversion wizard
The conversion wizard still only can do the same basic operation as the creation wizard, which is to add the api tools nature to the project. This does not perform a true api tools project setup. Adding a checkbox to the PDE property page will suffer from the same problem. Since API Tools sits higher on the stack, PDE cannot add/remove the builder, create a description file, etc. Possible solutions would be to add the checkbox to an API tools property page or use a preference to store and add a listener for it in API Tools.
(In reply to comment #8) > Possible solutions would be to add the checkbox to an API tools property page > or use a preference to store and add a listener for it in API Tools. The preference sounds like a good way for API tools to hook into the process. The biggest challenge I see is that we will lose the ability to convert component.xml files to API javadoc tags.
I have pushed the attached patch which solves the problem as described. I also updated the conversion tests to check that the nature is added successfully. Adding a check box to property page adds additional complexity and discussion should be held on bug 221913. Marking as FIXED.
Had to make an additional change to the conversion to add the java nature before adding the api tools nature. This was causing a test failure in pde ui. http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=c216e256565d2957ef646810f183d7247ba69bc5
Works nicely, except that my choice is not stored i.e. I have to check the checkbox every time I convert a project. Filed bug 359701 for that. I also fixed the string Enable API Analy&sis ==> Enable API analy&sis in HEAD.
Works well for me and bug reporter. Verified in I20111021-1625