[ https://issues.apache.org/jira/browse/FLINK-15866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17029031#comment-17029031 ]
Aven Wu commented on FLINK-15866: --------------------------------- Object type field was not implement Serializable, so checked it as unserialize object, and add check null before call superclass's method. > ClosureCleaner#getSuperClassOrInterfaceName throw NPE > ----------------------------------------------------- > > Key: FLINK-15866 > URL: https://issues.apache.org/jira/browse/FLINK-15866 > Project: Flink > Issue Type: Bug > Components: API / Core > Affects Versions: 1.9.2 > Reporter: Aven Wu > Priority: Critical > Labels: pull-request-available > Fix For: 1.10.0, 1.9.3 > > Time Spent: 10m > Remaining Estimate: 0h > > When param ‘cls’ is Object class, it will throw NPE. > {code:java} > private static String getSuperClassOrInterfaceName(Class<?> cls) { > Class<?> superclass = cls.getSuperclass(); > if (superclass.getName().startsWith("org.apache.flink")) { > return superclass.getSimpleName(); > } else { > for (Class<?> inFace : cls.getInterfaces()) { > if (inFace.getName().startsWith("org.apache.flink")) { > return inFace.getSimpleName(); > } > } > return null; > } > }{code} > Class<?> superclass = cls.getSuperclass(); > superclass is null > > -- This message was sent by Atlassian Jira (v8.3.4#803005)