You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2016/06/29 21:16:01 UTC

[2/2] cordova-plugin-network-information git commit: CB-11384 android: Does not pass sonarqube scan

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 <ro...@sap.com>
Authored: Mon Jun 6 15:13:13 2016 -0400
Committer: Jesse MacFadyen <pu...@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