Skip to content

Commit e400d16

Browse files
committed
A fix to handling of name explicitness; needed to prevent breakage of XML module that allows namespace-only overrides
1 parent 2bd58f5 commit e400d16

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -879,10 +879,17 @@ public Linked(T v, Linked<T> n,
879879
value = v;
880880
next = n;
881881
// ensure that we'll never have missing names
882-
this.name = (name == null || !name.hasSimpleName()) ? null : name;
882+
this.name = (name == null || name.isEmpty()) ? null : name;
883883

884-
if (explName && this.name == null) { // sanity check to catch internal problems
885-
throw new IllegalArgumentException("Can not pass true for 'explName' if name is null/empty");
884+
if (explName) {
885+
if (this.name == null) { // sanity check to catch internal problems
886+
throw new IllegalArgumentException("Can not pass true for 'explName' if name is null/empty");
887+
}
888+
// 03-Apr-2014, tatu: But how about name-space only override?
889+
// Probably should not be explicit? Or, need to merge somehow?
890+
if (!name.hasSimpleName()) {
891+
explName = false;
892+
}
886893
}
887894

888895
isNameExplicit = explName;

0 commit comments

Comments
 (0)