pvillard31 commented on code in PR #11370:
URL: https://github.com/apache/nifi/pull/11370#discussion_r3480269513
##########
nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFileUnpackagerV1.java:
##########
@@ -78,18 +78,17 @@ protected Map<String, String> getAttributes(final
TarArchiveInputStream stream)
for (final Entry<Object, Object> entry : props.entrySet()) {
final Object keyObject = entry.getKey();
final Object valueObject = entry.getValue();
- if (!(keyObject instanceof String)) {
+ if (!(keyObject instanceof final String key)) {
throw new IOException("Flow file attributes object contains
key of type "
+ keyObject.getClass().getCanonicalName()
+ " but expected java.lang.String");
- } else if (!(keyObject instanceof String)) {
+ }
+ if (!(valueObject instanceof final String value)) {
throw new IOException("Flow file attributes object contains
value of type "
+ keyObject.getClass().getCanonicalName()
Review Comment:
In the value type error, should this report
valueObject.getClass().getCanonicalName() instead of keyObject, so the message
shows the actual type of the bad value?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]