From e747faac1376a3c1fab2fe58b29be54d42b30137 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 19 Jul 2018 11:18:44 +0200 Subject: [PATCH] =?UTF-8?q?do=20not=20return=20empty=20element=20=E2=80=94?= =?UTF-8?q?=20return=20null=20as=20JDOMElementBinding=20does?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../util/src/com/intellij/util/xmlb/TagBinding.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/platform/util/src/com/intellij/util/xmlb/TagBinding.java b/platform/util/src/com/intellij/util/xmlb/TagBinding.java index 73b22a4b4543..7996be45a4fe 100644 --- a/platform/util/src/com/intellij/util/xmlb/TagBinding.java +++ b/platform/util/src/com/intellij/util/xmlb/TagBinding.java @@ -1,6 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.util.xmlb; import com.intellij.util.xmlb.annotations.Tag; @@ -31,11 +29,11 @@ class TagBinding extends BasePrimitiveBinding implements MultiNodeBinding { @Override public Object serialize(@NotNull Object o, @Nullable SerializationFilter filter) { Object value = myAccessor.read(o); - Element serialized = new Element(myName); if (value == null) { - return serialized; + return null; } + Element serialized = new Element(myName); if (myBinding == null) { serialized.addContent(new Text(XmlSerializerImpl.convertToString(value))); } @@ -97,7 +95,7 @@ class TagBinding extends BasePrimitiveBinding implements MultiNodeBinding { } @Override - public boolean isBoundTo(@NotNull Element node) { - return node.getName().equals(myName); + public boolean isBoundTo(@NotNull Element element) { + return element.getName().equals(myName); } } \ No newline at end of file