Skip to content

Conversation

cyuyang
Copy link

@cyuyang cyuyang commented Oct 31, 2022

According to the JDK doc, getSuperClass() could return null.

Returns the Class representing the direct superclass of the entity (class, interface, primitive type or void) represented by this Class. If this Class represents either the Object class, an interface, a primitive type, or void, then null is returned. If this object represents an array class then the Class object representing the Object class is returned.
Returns:
the direct superclass of the class represented by this object

In our env, without a null check first, this line caused scanning of parameter types that are interfaces to throw NPE.

@cyuyang cyuyang changed the title fix: check existence of superclass before access its name fix: check existence of superclass before accessing its name Oct 31, 2022
@bnasslahsen bnasslahsen merged commit a3b8290 into springdoc:master Nov 13, 2022
@cyuyang cyuyang deleted the fix-superclass branch November 21, 2022 22:19
mpleine pushed a commit to mpleine/springdoc-openapi that referenced this pull request May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants