nlu90 commented on a change in pull request #12706:
URL: https://github.com/apache/pulsar/pull/12706#discussion_r746205579
##########
File path:
pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/PrimitiveSchemaTest.java
##########
@@ -124,7 +124,7 @@ public void allSchemasShouldSupportNull(Map<Schema,
List<Object>> testData) {
assertNull(((AbstractSchema) schema).decode(byteBuf),
"Should support null in " +
schema.getSchemaInfo().getName() + " deserialization");
} catch (NullPointerException npe) {
- throw new NullPointerException("NPE when using schema " +
schema + " : " + npe.getMessage());
+ throw new IllegalArgumentException("NPE when using schema " +
schema + " : " + npe.getMessage(), npe);
Review comment:
`Avoid throwing NullPointerExceptions manually.` is the guide line I saw
from codacy.
--
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]