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
This commit is contained in:
Rob Close 2016-06-06 14:13:21 -04:00 committed by Vladimir Kotikov
parent aef8b9947b
commit bcdc0b9da0

View File

@ -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());
}
}