Remove unnecessary FieldDoesNotExistException handling
Previously, FieldDoesNotExistException was caught when extracting
a field to determine whether or not it is missing (absent or an
empty collection). The handling is redundant due to an earlier call
to hasField so this commit removes it.
Closes
@@ -84,16 +84,11 @@ class JsonContentHandler implements ContentHandler {
if (!this.fieldProcessor.hasField(candidate.getPath(), payload)) {
return true;
}
- try {
ExtractedField extracted = this.fieldProcessor.extract(candidate.getPath(),
payload);
return extracted.getValue() instanceof Collection
&& ((Collection<?>) extracted.getValue()).isEmpty();
}
- catch (FieldDoesNotExistException ex) {
- return true;
- }
- }
@Override
public String getUndocumentedContent(List<FieldDescriptor> fieldDescriptors) {
