cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [2/2] cordova-plugin-network-information git commit: CB-11384 android: Does not pass sonarqube scan
Date Wed, 29 Jun 2016 21:16:01 GMT
CB-11384 android: Does not pass sonarqube scan

The problem is "Empty Catch Block", which sonarqube considers a blocker. Added
a log message to the empty block.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/commit/da7e85ec
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/tree/da7e85ec
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/diff/da7e85ec

Branch: refs/heads/master
Commit: da7e85ec92a200ffb60cdb25827d58dce3bef8f2
Parents: 83e870b
Author: Rob Close <rob.close@sap.com>
Authored: Mon Jun 6 15:13:13 2016 -0400
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Wed Jun 29 14:06:04 2016 -0700

----------------------------------------------------------------------
 src/android/NetworkManager.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/da7e85ec/src/android/NetworkManager.java
----------------------------------------------------------------------
diff --git a/src/android/NetworkManager.java b/src/android/NetworkManager.java
index 59965bd..29066fa 100755
--- a/src/android/NetworkManager.java
+++ b/src/android/NetworkManager.java
@@ -127,7 +127,9 @@ public class NetworkManager extends CordovaPlugin {
             String connectionType = "";
             try {
                 connectionType = this.getConnectionInfo(info).get("type").toString();
-            } catch (JSONException e) { }
+            } catch (JSONException e) {
+                Log.d(LOG_TAG, e.getLocalizedMessage());
+            }
 
             PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, connectionType);
             pluginResult.setKeepCallback(true);
@@ -171,7 +173,9 @@ public class NetworkManager extends CordovaPlugin {
             String connectionType = "";
             try {
                 connectionType = thisInfo.get("type").toString();
-            } catch (JSONException e) { }
+            } catch (JSONException e) {
+                Log.d(LOG_TAG, e.getLocalizedMessage());
+            }
 
             sendUpdate(connectionType);
             lastInfo = thisInfo;
@@ -206,7 +210,9 @@ public class NetworkManager extends CordovaPlugin {
         try {
             connectionInfo.put("type", type);
             connectionInfo.put("extraInfo", extraInfo);
-        } catch (JSONException e) { }
+        } catch (JSONException e) {
+            Log.d(LOG_TAG, e.getLocalizedMessage());
+        }
 
         return connectionInfo;
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message