reinert/JJSchema — pull request #32 by vikas-nalwar (2014-06-10 12:23:11+00:00)
Title: Fixed a NPE in Schema generation

Schema generation fails with NullPointerException when generating
schema from java classes containing java.net.URL fields. Below is the
code snippet to reproduce the issue.

JsonSchemaGenerator v4generator =
SchemaGeneratorBuilder.draftV4Schema().build();
JsonNode schema = v4generator.generateSchema(java.net.URL.class);

Initial investigation reveals a missing null check in mergeWithParent()
method of the JsonSchemaGenerator class. The superclass for
Object.class is null and hence NullPointerException occurs in the
subsequent if block. Adding a null check on superclass in the if
condition solves the issue. Below is the corrected snippet.

if (superclass != null && superclass != Object.class)