Fix NPE
Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/3645943b Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/3645943b Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/3645943b Branch: refs/heads/STABLE-4.0 Commit: 3645943bfb04e365929dba7949ef5cb2111d299c Parents: 4be0bea Author: Nikita Timofeev <stari...@gmail.com> Authored: Wed Sep 19 14:13:59 2018 +0300 Committer: Arseni Bulatski <ancars...@gmail.com> Committed: Tue Sep 25 12:40:41 2018 +0300 ---------------------------------------------------------------------- .../modeler/dialog/objentity/ObjAttributeInfoDialog.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne/blob/3645943b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java index 8e4c5f8..ba078b4 100644 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java +++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java @@ -63,6 +63,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; public class ObjAttributeInfoDialog extends CayenneController implements TreeSelectionListener { @@ -422,11 +423,12 @@ public class ObjAttributeInfoDialog extends CayenneController implements TreeSel public boolean isChange() { - boolean isOvverideTableChange = ((OverrideEmbeddableAttributeTableModel) view.getOverrideAttributeTable() + boolean isOverrideTableChange = ((OverrideEmbeddableAttributeTableModel) view.getOverrideAttributeTable() .getModel()).isAttributeOverrideChange(); - return isOvverideTableChange || !attribute.getName().equals(view.getAttributeName().getText()) - || (attribute.getType() == null && view.getTypeComboBox().getSelectedItem().toString() != null) - || !attribute.getType().equals(view.getTypeComboBox().getSelectedItem().toString()); + return isOverrideTableChange + || !attribute.getName().equals(view.getAttributeName().getText()) + || (attribute.getType() == null && view.getTypeComboBox().getSelectedItem() != null) + || !Objects.equals(attribute.getType(), view.getTypeComboBox().getSelectedItem()); } public void saveMapping() {