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

CHE-4939: Fix bugs related to processing of read-only files #5003

Merged
merged 1 commit into from
May 16, 2017

Conversation

RomanNikitenko
Copy link
Member

Signed-off-by: Roman Nikitenko rnikitenko@codenvy.com

What does this PR do?

Fix bugs related to processing of read-only files:

  1. Do not try to save a content of read-only files
  2. Close read-only files when project is removed
  3. Do not display a browser popup with warning "Change you made may not be saved" for read-only files at attempt to refresh page.

What issues does this PR fix or reference?

#4939

Changelog

Fix bugs related to processing of read-only files

ResourceDelta delta = event.getDelta();
Path resourceLocation = delta.getResource().getLocation();

if (project.equals(resourceLocation) && REMOVED == delta.getKind()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Check for delta kind at first, then for equality of resources. It will be faster than this condition.


private void removeHandlers() {
if (fileEventHandlerRegistration != null) {
fileEventHandlerRegistration.removeHandler();
Copy link
Contributor

Choose a reason for hiding this comment

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

Set fileEventHandlerRegistration to null.

}

if (resourceChangeHandlerRegistration != null) {
resourceChangeHandlerRegistration.removeHandler();
Copy link
Contributor

Choose a reason for hiding this comment

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

Set resourceChangeHandlerRegistration to null also.

Copy link
Contributor

@vzhukovs vzhukovs left a comment

Choose a reason for hiding this comment

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

Other ok

@codenvy-ci
Copy link

@codenvy-ci
Copy link

@RomanNikitenko RomanNikitenko added this to the 5.11.0 milestone May 16, 2017
Signed-off-by: Roman Nikitenko <rnikitenko@codenvy.com>
@codenvy-ci
Copy link

Build # 2604 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/2604/ to view the results.

@slemeur slemeur added the kind/bug Outline of a bug - must adhere to the bug report template. label May 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants