From 75bd326709b5cb640f5206ca1c7128536f9e2bfa Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 16 Aug 2013 16:23:26 +0200 Subject: fix minor code style issues --HG-- extra : rebase_source : 713a275b9689e1bf413f8e4ee80d115842fa7f31 --- src/de/blinkt/openvpn/VpnProfile.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/de/blinkt') diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index 6b7cffab..9ee0f9db 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -415,6 +415,7 @@ public class VpnProfile implements Serializable { PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0); version = packageinfo.versionName; } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); } return String.format(Locale.US, "setenv IV_OPENVPN_GUI_VERSION \"%s %s\"\n", c.getPackageName(), version); @@ -544,7 +545,7 @@ public class VpnProfile implements Serializable { String[] getKeyStoreCertificates(Context context) { PrivateKey privateKey = null; - X509Certificate[] cachain = null; + X509Certificate[] cachain; try { privateKey = KeyChain.getPrivateKey(context, mAlias); mPrivateKey = privateKey; @@ -764,7 +765,7 @@ public class VpnProfile implements Serializable { public String getSignedData(String b64data) { PrivateKey privkey = getKeystoreKey(); - Exception err = null; + Exception err; byte[] data = Base64.decode(b64data, Base64.DEFAULT); @@ -796,15 +797,15 @@ public class VpnProfile implements Serializable { } catch (BadPaddingException e) { err = e; } - if (err != null) { - OpenVPN.logError(R.string.error_rsa_sign, err.getClass().toString(), err.getLocalizedMessage()); - } + + OpenVPN.logError(R.string.error_rsa_sign, err.getClass().toString(), err.getLocalizedMessage()); + return null; } private String processSignJellyBeans(PrivateKey privkey, byte[] data) { - Exception err = null; + Exception err; try { Method getKey = privkey.getClass().getSuperclass().getDeclaredMethod("getOpenSSLKey"); getKey.setAccessible(true); @@ -835,9 +836,8 @@ public class VpnProfile implements Serializable { } catch (InvalidKeyException e) { err = e; } - if (err != null) { - OpenVPN.logError(R.string.error_rsa_sign, err.getClass().toString(), err.getLocalizedMessage()); - } + OpenVPN.logError(R.string.error_rsa_sign, err.getClass().toString(), err.getLocalizedMessage()); + return null; } -- cgit v1.2.3