-
Notifications
You must be signed in to change notification settings - Fork 116
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
Project description links information is not reconciled on project close and reopen #470
Comments
Just wondering, why should project still point to the link if this information is explicitly deleted from .project? |
I don't think it should, but the link information is stale and not updated (this bug). Our product is using classpath information (the claspath for whatever reason remains the same despite the |
Seems like
I.e. it reads the current disk state. The old description is supposed to be the one in memory. Unfortunately its no longer available at the time of the re-open. After the re-open, a project description is created here:
Another description is then created with this call:
So the new description is the last one, created when opening the project. And the previous (old) description is also read from disk when opening the project (and so has no links information), as opposed to using the in-memory description (that had links information). The in-memory description is gone after the close, e.g. if I add this code, there is no old description at the time of this new reconcile call:
|
Considering there is no old state to compare to, I wonder if we want to delete the linked folder resources (the project children, not the actual target folders) from the workspace on project close. If they are re-created on project open (due to being read from Then again there already is this code in
I guess the next step here is to add a test, so that we are not depending on our product to reproduce. Making it easier to debug and understand what resource infos exist and why they are stale. |
Fixes: eclipse-platform#470 Signed-off-by: Simeon Andreev <[email protected]>
Whenever a project is closed, its resource tree is saved. This includes linked resources in the project. When the project is re-opened, link changes in the .project file are not reflected on the projects resource tree. The old resource tree is read, new information is stored in ProjectDescription.linkDescriptions, but the old linked resources are not touched. This change adjusts Project.open() and Project.close() to set resp. clear the M_LINK flag of linked resources in the project. Fixes: eclipse-platform#470 Signed-off-by: Simeon Andreev <[email protected]>
Whenever a project is closed, its resource tree is saved. This includes linked resources in the project. When the project is re-opened, link changes in the .project file are not reflected on the projects resource tree. The old resource tree is read, new information is stored in ProjectDescription.linkDescriptions, but the old linked resources are not touched. This change adjusts Project.open() and Project.close() to set resp. clear the M_LINK flag of linked resources in the project. Fixes: eclipse-platform#470 Signed-off-by: Simeon Andreev <[email protected]>
With the current state of affairs, deleting links from .project file by external file modification isn't supported and "leaks" any linked folder added before. While adding "linked" folders one has provided a way to create them automatically (by reading .project file) but didn't provided a 100% safe way to delete them automatically - it works only if they were removed by Eclipse UI or by editing the file in Eclipse. The use case not working is "external delete" by modifying .project file outside of Eclipse while project is closed or Eclipse is not open at all.
The "externally deleted" linked folder has following implications:
Looking at the code, I assume |
I believe proposed PR doesn't cover the use case we have completely, as it only works on open/close of projects. So it can't detect changes made while Eclipse was closed (e.g. close Eclipse, change .project file to remove links, open Eclipse). What we need is to detect external changes independently on open/close/not started Eclipse. There we could try to use knowledge we have from
To reconcile links info we can brute force traverse whole tree and check if the found links are known by |
Whenever a project is closed, its resource tree is saved. This includes linked resources in the project. When the project is re-opened, link changes in the .project file are not reflected on the projects resource tree. The old resource tree is read, new information is stored in ProjectDescription.linkDescriptions, but the old linked resources are not touched. This change adjusts Project.open() and Project.close() to set resp. clear the M_LINK flag of linked resources in the project. Fixes: eclipse-platform#470 Signed-off-by: Simeon Andreev <[email protected]>
In our product, we have a builder that reads linked folders. The builder runs into a NPE, due to stale links information. The stale links information results due to the following sequence:
Project.reconcileLinksAndGroups()
.oldDescription.getLinks()
returnsnull
and so nothing is done to refresh the links information.The information about links in the project description is not persisted in
LocalMetaArea.writePrivateDescription()
and is also not read inLocalMetaArea.readPrivateDescription()
. We should fix this, to ensure up-to-date links information in the project description after opening a closed project.The text was updated successfully, but these errors were encountered: