Skip to content
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

Add rough sketch for a bugfix for #885 #893

Merged

Conversation

erik-brangs
Copy link
Contributor

As requested by @mickaelistria in #885 , here is a pull request that highlights where exists() checks might be missing.

The fix is probably wrong because I wasn't actually able to reproduce the problem. The associated test seems to trigger a different problem.

I suppose the original problem is triggered by the order of operations. I don't know enough to reproduce it in a test case.

@erik-brangs erik-brangs force-pushed the issue-885-problem-occurred-popup branch from 98be719 to 7f8a855 Compare January 13, 2024 12:18
@erik-brangs
Copy link
Contributor Author

The test testDiagnosticsForMarkerUpdateAfterProjectClose now reproduces the original problem.

However, I don't know if this fully solves the problem with missing exists() checks. I've added some more exists() checks in other places where errors occurred when trying to write the tests. However, I can't reproduce those reliably. This also applies to the testDiagnosticsForMarkerUpdateAfterDeletedFile test.

The markers rule seems to be null in the tests. Is this normal?

@erik-brangs erik-brangs force-pushed the issue-885-problem-occurred-popup branch from 7f8a855 to 20ab024 Compare January 13, 2024 14:37
}
for (Entry<IMarker, Diagnostic> entry : toUpdate.entrySet()) {
Map<String, Object> markerAttributes = computeMarkerAttributes(document, entry.getValue(), resource);
updateMarker(markerAttributes, entry.getKey());
if (resource.exists()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't it be if (entry.getKey().exists()) here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right.

…ources that do not exist (eclipse#885)

Due to job scheduling, the job may run after the resources are no longer accessible (e.g. because the project was closed).
@erik-brangs erik-brangs force-pushed the issue-885-problem-occurred-popup branch from 20ab024 to 367a2ad Compare January 15, 2024 18:17
@mickaelistria mickaelistria merged commit 62b7b15 into eclipse:master Jan 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants