You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/11/10 02:22:51 UTC

[GitHub] [pulsar] Jason918 commented on a change in pull request #12706: [WIP] clean code style issues

Jason918 commented on a change in pull request #12706:
URL: https://github.com/apache/pulsar/pull/12706#discussion_r746197291



##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/client/api/InterceptorsTest.java
##########
@@ -151,12 +151,12 @@ public void close() {
 
             @Override
             public Message<String> beforeSend(Producer<String> producer, Message<String> message) {
-                throw new NullPointerException();
+                throw new IllegalArgumentException();

Review comment:
       Maybe NotImplementException is better?

##########
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:
       Why change NullPointerException to IllegalArgumentException here?




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org