Skip to content

Commit

Permalink
Skip errors when visiting default implementations in ConfigurationMet…
Browse files Browse the repository at this point in the history
…adata (#3577)

Fixes #3557
  • Loading branch information
joschi committed Nov 26, 2020
1 parent c6bff05 commit 5c31917
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -106,6 +106,7 @@ public boolean isCollectionOfStrings(String fieldName) {
}

@Override
@SuppressWarnings("java:S106")
public JsonObjectFormatVisitor expectObjectFormat(JavaType type) throws JsonMappingException {
// store the pointer to the own instance
final ConfigurationMetadata thiss = this;
Expand Down Expand Up @@ -159,8 +160,11 @@ public void optionalProperty(BeanProperty prop) throws JsonMappingException {
parentProps.add(prop);

// visit the type of the property (or its defaultImpl).
mapper.acceptJsonFormatVisitor(
defaultImpl == null ? fieldType.getRawClass() : defaultImpl, thiss);
try {
mapper.acceptJsonFormatVisitor(defaultImpl == null ? fieldType.getRawClass() : defaultImpl, thiss);
} catch (NoClassDefFoundError | Exception e) {
System.err.println(getClass() + ": " + e.getMessage());
}

// reset state after the recursive traversal
parentProps.remove(prop);
Expand Down

0 comments on commit 5c31917

Please sign in to comment.