You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/07/03 07:47:58 UTC

[GitHub] [iotdb] SteveYurongSu commented on issue #3481: One NPE in LogicalChecker.java

SteveYurongSu commented on issue #3481:
URL: https://github.com/apache/iotdb/issues/3481#issuecomment-873364490


   I'd like to call this a code smell, because the NPE will not be triggered at any time.
   
   ![image](https://user-images.githubusercontent.com/30497621/124347102-3bc32200-dc15-11eb-9ff2-6945a542f28d.png)
   
   The method `getDevice` is called in another method `checkAlignByDevice`, and the method `checkAlignByDevice` is called only if the system is executing a align-by-device query.
   
   ![image](https://user-images.githubusercontent.com/30497621/124347144-98264180-dc15-11eb-83bb-bb96e0d0b401.png)
   
   If a query is a align-by-device query, the branch you mentoned at 1 (`pathsCache.add(null); `) will not be accessed, so there will be no NPEs.
   
   I wll fix the code smell. 
   
   Thanks for the discovery!


-- 
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: reviews-unsubscribe@iotdb.apache.org

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