You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2016/06/08 09:41:11 UTC

cordova-plugin-inappbrowser git commit: CB-11381 android: Does not pass sonarqube scan

Repository: cordova-plugin-inappbrowser
Updated Branches:
  refs/heads/master aef8b9947 -> bcdc0b9da


CB-11381 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.

 This closes #169


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

Branch: refs/heads/master
Commit: bcdc0b9da01862dacac554db5fd6836d6463c4cc
Parents: aef8b99
Author: Rob Close <ro...@sap.com>
Authored: Mon Jun 6 14:13:21 2016 -0400
Committer: Vladimir Kotikov <ko...@gmail.com>
Committed: Wed Jun 8 12:40:50 2016 +0300

----------------------------------------------------------------------
 src/android/InAppBrowser.java | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/bcdc0b9d/src/android/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
index f105a62..30915dc 100644
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@ -142,8 +142,11 @@ public class InAppBrowser extends CordovaPlugin {
                                 Method iuw = Config.class.getMethod("isUrlWhiteListed", String.class);
                                 shouldAllowNavigation = (Boolean)iuw.invoke(null, url);
                             } catch (NoSuchMethodException e) {
+                                Log.d(LOG_TAG, e.getLocalizedMessage());
                             } catch (IllegalAccessException e) {
+                                Log.d(LOG_TAG, e.getLocalizedMessage());
                             } catch (InvocationTargetException e) {
+                                Log.d(LOG_TAG, e.getLocalizedMessage());
                             }
                         }
                         if (shouldAllowNavigation == null) {
@@ -153,8 +156,11 @@ public class InAppBrowser extends CordovaPlugin {
                                 Method san = pm.getClass().getMethod("shouldAllowNavigation", String.class);
                                 shouldAllowNavigation = (Boolean)san.invoke(pm, url);
                             } catch (NoSuchMethodException e) {
+                                Log.d(LOG_TAG, e.getLocalizedMessage());
                             } catch (IllegalAccessException e) {
+                                Log.d(LOG_TAG, e.getLocalizedMessage());
                             } catch (InvocationTargetException e) {
+                                Log.d(LOG_TAG, e.getLocalizedMessage());
                             }
                         }
                         // load in webview
@@ -933,8 +939,11 @@ public class InAppBrowser extends CordovaPlugin {
                 Method gpm = webView.getClass().getMethod("getPluginManager");
                 pluginManager = (PluginManager)gpm.invoke(webView);
             } catch (NoSuchMethodException e) {
+                Log.d(LOG_TAG, e.getLocalizedMessage());
             } catch (IllegalAccessException e) {
+                Log.d(LOG_TAG, e.getLocalizedMessage());
             } catch (InvocationTargetException e) {
+                Log.d(LOG_TAG, e.getLocalizedMessage());
             }
 
             if (pluginManager == null) {
@@ -942,7 +951,9 @@ public class InAppBrowser extends CordovaPlugin {
                     Field pmf = webView.getClass().getField("pluginManager");
                     pluginManager = (PluginManager)pmf.get(webView);
                 } catch (NoSuchFieldException e) {
+                    Log.d(LOG_TAG, e.getLocalizedMessage());
                 } catch (IllegalAccessException e) {
+                    Log.d(LOG_TAG, e.getLocalizedMessage());
                 }
             }
 


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