javeme commented on code in PR #2063: URL: https://github.com/apache/incubator-hugegraph/pull/2063#discussion_r1058992929
########## hugegraph-core/src/main/java/org/apache/hugegraph/structure/HugeElement.java: ########## @@ -430,15 +433,19 @@ public static final ElementKeys classifyKeys(Object... keyValues) { throw Element.Exceptions .providedKeyValuesMustHaveALegalKeyOnEvenIndices(); } - if (val == null) { - if (key.equals(T.label)) { + + if(ObjectUtils.isEmpty(val)) { + if (val == null && key.equals(T.label)) { throw Element.Exceptions.labelCanNotBeNull(); + } else if (key.equals(T.label)) { + throw Element.Exceptions.labelCanNotBeEmpty(); } throw Property.Exceptions.propertyDoesNotExist(); } if (key.equals(T.id)) { elemKeys.id = val; + Review Comment: can remove the blank line ########## hugegraph-core/src/main/java/org/apache/hugegraph/structure/HugeElement.java: ########## @@ -55,6 +56,8 @@ import org.apache.hugegraph.util.E; import org.apache.hugegraph.util.InsertionOrderUtil; +import com.alipay.remoting.util.StringUtils; Review Comment: useless import? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@hugegraph.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org