saintstack commented on a change in pull request #836: HBASE-23308: Review of
NullPointerExceptions
URL: https://github.com/apache/hbase/pull/836#discussion_r347117195
##########
File path:
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupDriver.java
##########
@@ -187,10 +188,7 @@ public static void main(String[] args) throws Exception {
@Override
public int run(String[] args) throws IOException {
- if (conf == null) {
- LOG.error("Tool configuration is not initialized");
- throw new NullPointerException("conf");
- }
+ Objects.requireNonNull(conf, "Tool configuration is not initialized");
Review comment:
Looks nice. Is there an advantage to this approach? Thanks.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services