Community
Participate
Working Groups
1. Open Eclipse 3.1.2 with a new workspace. 2. Create a java project. 3. Set the Java Compiler settings to be project-specific and select java 5.0. 4. Create a java source file that uses any annotation (such as @Override). 5. Verify that you are not seeing any problem markers. 6. Close the project in the workspace. 7. Close Eclipse 3.1.2. 8. Open the same workspace in Eclipse 3.3. 9. Open the project. 10. Open the source file with the annotation. 11. The annotation should be flagged as a problem now. 12. Go into the project properties -> Java Compiler and notice that the panel is not registered to use the project preferences. 13. Touch the org.eclipse.jst.core.prefs file without making any actual content changes. The problem goes away and the Java Compiler project properties panel displays the correct information.
My guess is that this is more a jdt-core (rather than jdt-ui) issue, since problem markers are placed on the annotation...
I followed the steps and everything seems to work fine for me. On step 11, I don't get an error on the opened file. Opening the property page as in step 12 shows that the settings are project settings. Do you have more input here?
This repros for me in 3.3M3. Note that you need to manually close the project (step #6) in 3.1.2. Otherwise the problem does not occur.
Ok, now I got it, I forgot to close/open the project. I think the bug is in core.resources. The .settings file seems to be there, but when programatically accessing these project settings, null is returned.
Moving to resources as the bug appears to be in resources.
It works since 3.7M2a. I found that 3.7M2a with jdt.ui plugin from 3.7M1 does not work so the problems was fixed somewhere in jdt.ui plug-in. Moving back to JDT/UI to comment and possible closure.
(In reply to comment #4) > I think the bug is in core.resources. The .settings file seems to be there, but > when programatically accessing these project settings, null is returned. That's exactly the point. The "fix" is the removal of a few lines in org.eclipse.jdt.internal.ui.preferences.formatter.FormatterProfileStore#checkCurrentOptionsVersion() rev. 1.4 (but that change has been released for other reasons, see bug 324995). Concretely, we used to call ... IEclipsePreferences preferences= new ProjectScope(project) .getNode("org.eclipse.jdt.core"); ... on the *closed* project. That returns an IEclipsePreferences that does not contain the initial values from the file on disk. Later on, when user has opened the project, this preferences node apparently doesn't get updated and still returns no values, although the opened project has stored preferences. Moving back to Platform/Resources to make sure the preferences object gets updated when a project is opened. To reproduce, check out FormatterProfileStore rev. 1.3.
Thanks for clarification Markus. We already have bug 202384 to handle re-initialization of ProjectPreferences when project is opened. I will test on Monday if patch for bug 202384 fixes also this problem with FormatterProfileStore rev. 1.3.
*** This bug has been marked as a duplicate of bug 202384 ***