mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
equals() in the object hierarchy must check for class
This commit is contained in:
@@ -120,6 +120,8 @@ public abstract class AbstractTreeNode<T> extends PresentableNodeDescriptor<Abst
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
if (object == this) return true;
|
||||
if (object == null || !object.getClass().equals(getClass())) return false;
|
||||
// we should not change this behaviour if value is set to null
|
||||
return object instanceof AbstractTreeNode && Comparing.equal(myValue, ((AbstractTreeNode)object).myValue);
|
||||
}
|
||||
|
||||
-8
@@ -31,14 +31,6 @@ public class CustomResourceBundlePropertiesFileNode extends PsiFileNode implemen
|
||||
data.setLocationString(PropertiesBundle.message("project.view.resource.bundle.tree.node.text", getResourceBundle().getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (!(object instanceof CustomResourceBundlePropertiesFileNode)) {
|
||||
return false;
|
||||
}
|
||||
return Comparing.equal(getValue(), ((CustomResourceBundlePropertiesFileNode)object).getValue());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ResourceBundle getResourceBundle() {
|
||||
|
||||
Reference in New Issue
Block a user