saintstack commented on a change in pull request #836: HBASE-23308: Review of 
NullPointerExceptions
URL: https://github.com/apache/hbase/pull/836#discussion_r347117251
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
 ##########
 @@ -7322,13 +7323,14 @@ public static HRegion openHRegion(final Configuration 
conf, final FileSystem fs,
    * @param rsServices An interface we can request flushes against.
    * @param reporter An interface we can report progress against.
    * @return new HRegion
+   * @throws NullPointerException if {@code info} is {@code null}
    */
   public static HRegion openHRegion(final Configuration conf, final FileSystem 
fs,
       final Path rootDir, final Path tableDir, final RegionInfo info, final 
TableDescriptor htd,
       final WAL wal, final RegionServerServices rsServices,
       final CancelableProgressable reporter)
       throws IOException {
-    if (info == null) throw new NullPointerException("Passed region info is 
null");
+    Objects.requireNonNull(info, "RegionInfo cannot be null");
 
 Review comment:
   Should we add @NotNull annotations given you are in here? Could be a 
follow-on no problem.

----------------------------------------------------------------
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

Reply via email to