You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by GitBox <gi...@apache.org> on 2019/04/02 09:47:58 UTC

[GitHub] [sqoop] szvasas commented on a change in pull request #77: SQOOP-3435 Avoid NullPointerException due to different JSONObject library in classpath

szvasas commented on a change in pull request #77: SQOOP-3435 Avoid NullPointerException due to different JSONObject library in classpath
URL: https://github.com/apache/sqoop/pull/77#discussion_r271218043
 
 

 ##########
 File path: src/java/org/apache/sqoop/util/SqoopJsonUtil.java
 ##########
 @@ -40,6 +40,9 @@ private SqoopJsonUtil() {
   }
 
   public static String getJsonStringforMap(Map<String, String> map) {
+    if (map == null) {
 
 Review comment:
   Nit: it is a good practice not to reassign the input parameters so I would change this to something like the following:
   `Map<String, String> mapToUse = (map == null) ? emptyMap() : map;
     JSONObject pathPartMap = new JSONObject(mapToUse);`
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services