Github user rmetzger commented on a diff in the pull request:
https://github.com/apache/incubator-flink/pull/236#discussion_r20933753
--- Diff:
flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java
---
@@ -116,25 +168,36 @@ public boolean isStateful() {
@Override
public T createInstance() {
+ if (clazz.isInterface() ||
Modifier.isAbstract(clazz.getModifiers())) {
+ return null;
+ }
try {
T t = clazz.newInstance();
-
- for (int i = 0; i < numFields; i++) {
- fields[i].set(t,
fieldSerializers[i].createInstance());
- }
-
+ initializeFields(t);
return t;
}
catch (Exception e) {
- throw new RuntimeException("Cannot instantiate class.",
e);
+// throw new RuntimeException("Cannot instantiate class.",
e);
+ return null;
--- End diff --
Why are you returning `null` on error?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---