Community
Participate
Working Groups
JavaProject#setOptions(Map) always sets *new* Preferences. Listeners on the old preferences do not receive events from the new preferences. It is therefore not possible to use listeners on the project preferences.
Side effect of bug 26255. We need to change the way we're resetting preferences to avoid loosing property listeners...
One question: how do you get project preferences although there are not accessible using IJavaProject interface?
Using the internal API. The problem is that I need a way to listen on the project preferences (not using the internal API of course).
Fixed. Talking about this with Philippe, we would advice not to use an internal API to solve your problem of listening to preferences changes. However, we'll fix this bug as we have a way to change this at low cost, but this is NOT an encouragement to internal API usage! If you think there's absolutely no other way for you to solve your problem, then you have to open a new feature request to make these preferences accessible using an official API... Some internal info about this bug fix: ------------------------------------- Modify JavaProject.setOptions(Map) as we always use existing preferences instead of recreate them. Add a reset to default value for all options which are not present in given map. Also remove default value initialisation in getOptions(boolean) method. When inheriting from JavaCore options, only initialize map with JavaCore.getOptions () one. Previous code which set all keys value with default value has been removed as for JavaProject due to the fact that default value is _always_ invalid... Modify existing test case test07 in jdt.core.tests.model.OptionTests
Christof, did you file a PR for the new listener API? If so, what's the number? If not, please file it.
Verified for 3.0M7
Comment 5: I filed bug 72234 as a follow-up.