-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cyclic dependency between ProjectPreferences and Workspace init #87
Conversation
The Jenkins build of this PR has now completed. See details at https://ci.eclipse.org/platform/job/eclipse.platform.resources/job/PR-87/1/ |
So any activator which uses regular preferences API may cause the same issue? |
No that is a bit different as it will trigger activation of the Resource plugin and then "wait" for Workspace init (hopefully this does not take to long ...) while in this case we are in the (internal) init phase so should avoid relying to much on other parts that indirectly "recall". Anyways I opened eclipse-equinox/equinox.bundles#24 to make this more declarative and do not require plugins to use activator at all or call static methods for this common use-case. |
bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Workspace.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need legacy code if we change calls order as proposed.
The Jenkins build of this PR has now completed. See details at https://ci.eclipse.org/platform/job/eclipse.platform.resources/job/PR-87/2/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to keep the initializePreferenceLookupOrder()
inside open()
call. The changes in the workspace init order are really hard to understand (like eclipse-platform/eclipse.platform.runtime#35 that was caused by a "trivial" 1:1 change in a8a8d82).
Old order should be preserved now (just moved the save a bit above), looking at the code it feels like both statements should be moved down |
The Jenkins build of this PR has now completed. See details at https://ci.eclipse.org/platform/job/eclipse.platform.resources/job/PR-87/3/ |
thanks.
That was my original proposal (to move preferences order init after setting encoding)
The WorkspacePreferences is a "legacy wrapper" to few preference values that were previously in an xml file, see #93 |
So probably it would make sense to first getting #93 done and then rebase on that change? |
Sure, that's the reason you are set as reviewer on PR :-) |
Rebased now. |
The Jenkins build of this PR has now completed. See details at https://ci.eclipse.org/platform/job/eclipse.platform.resources/job/PR-87/4/ |
Thanks, looks good, I'm looking into it now once again, just to be sure we don't change any logic here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Fix #86
Its not that nice because we use deprecated Preferences API here, but this prevents the implicit early Workspace access and is consistent to how
ResourcesPlugin.getEncoding()
andWorkspaceRoot.getDefaultCharset(boolean)
behaves here.Actually it would be good if none would ever call
ResourcesPlugin.getEncoding()
but insteadWorkspace.getRoot().getDefaultCharset()
but unless this do not change we should simply keep this behavior here.