提交 17a88352 编写于 作者: J Jesse Glick

newInstancesFromHeteroList should recover gracefully from the case that both...

newInstancesFromHeteroList should recover gracefully from the case that both kind and $class are missing.
上级 3080573a
...@@ -921,14 +921,18 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable { ...@@ -921,14 +921,18 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
d = findById(descriptors, kind); d = findById(descriptors, kind);
} }
if (d == null) { if (d == null) {
kind = jo.getString("$class"); kind = jo.optString("$class");
d = findByDescribableClassName(descriptors, kind); if (kind != null) {
if (d == null) d = findByClassName(descriptors, kind); d = findByDescribableClassName(descriptors, kind);
if (d == null) {
d = findByClassName(descriptors, kind);
}
}
} }
if (d != null) { if (d != null) {
items.add(d.newInstance(req, jo)); items.add(d.newInstance(req, jo));
} else { } else {
LOGGER.warning("Received unexpected formData for descriptor " + kind); LOGGER.log(Level.WARNING, "Received unexpected formData: {0}", jo);
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册