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

RHBA-415: After rename, designer is not marked as dirty more #842

Merged
merged 1 commit into from
Apr 6, 2018

Conversation

@@ -49,7 +49,7 @@ public void fireChangeTitleEvent() {
if (dtPath == null) {
return;
}
if (dtPath.equals(path)) {
if (path.equals(dtPath)) {
Copy link
Member

Choose a reason for hiding this comment

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

Out of interest, why did you need to change the order of the equality check?

Both parameters were checked for null before the comparison.

Copy link
Contributor Author

@karreiro karreiro Apr 4, 2018

Choose a reason for hiding this comment

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

@manstis yeah, this change is tricky. Here we want to use the .equals method from the PathImpl (path), not from the ObservablePath (dtPath).

(I covered it with tests to avoid some regression, if we change the line 52 back to the if (dtPath.equals(path)), the testFireChangeTitleEvent_LockInfoUpdateForActiveDecisionTable breaks) :-)

Copy link
Member

Choose a reason for hiding this comment

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

@karreiro Sounds like an equals(..) implementation is broken somewhere :-(

https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)

"It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true."

I wonder whether it is better to fix the offending implementation?

Copy link
Contributor Author

@karreiro karreiro Apr 5, 2018

Choose a reason for hiding this comment

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

@manstis Definitely, the implementation of the ObservablePathImpl#equals is not symmetric. Sometimes it uses the o.original, sometime it uses the o (here) :-(

My first approach was to change it. However, the current implementation is widely used and the instability that I created does worth. So, instead of that, I preferred to make a specific/small fix with less impact.

I definitely agree that ObservablePathImpl#equals needs to be refactored, but I think we could raise another JIRA for that.

Copy link

@jomarko jomarko left a comment

Choose a reason for hiding this comment

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

Leaving decision around equals method to you. checked manually, fix works. Thanks. Probably cherry-pick will be needed into 7.7.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants