Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java

Issue 112163002: Fixing Java style errors in net/android/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update known findbugs Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
diff --git a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
index 2d51f42f9da6d7f9a2de19f81d8d32dc24a6a9cc..83775d895b2bd54cdea6d4057ae75499f4889b3e 100644
--- a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
+++ b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -33,9 +33,9 @@ class AndroidNetworkLibrary {
/**
* Stores the key pair through the CertInstaller activity.
- * @param context: current application context.
- * @param public_key: The public key bytes as DER-encoded SubjectPublicKeyInfo (X.509)
- * @param private_key: The private key as DER-encoded PrivateKeyInfo (PKCS#8).
+ * @param context current application context.
+ * @param publicKey The public key bytes as DER-encoded SubjectPublicKeyInfo (X.509)
+ * @param privateKey The private key as DER-encoded PrivateKeyInfo (PKCS#8).
* @return: true on success, false on failure.
*
* Note that failure means that the function could not launch the CertInstaller
@@ -43,15 +43,15 @@ class AndroidNetworkLibrary {
* by the CertInstaller UI itself.
*/
@CalledByNative
- static public boolean storeKeyPair(Context context, byte[] public_key, byte[] private_key) {
+ public static boolean storeKeyPair(Context context, byte[] publicKey, byte[] privateKey) {
// TODO(digit): Use KeyChain official extra values to pass the public and private
// keys when they're available. The "KEY" and "PKEY" hard-coded constants were taken
// from the platform sources, since there are no official KeyChain.EXTRA_XXX definitions
// for them. b/5859651
try {
Intent intent = KeyChain.createInstallIntent();
- intent.putExtra("PKEY", private_key);
- intent.putExtra("KEY", public_key);
+ intent.putExtra("PKEY", privateKey);
+ intent.putExtra("KEY", publicKey);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return true;
@@ -65,9 +65,9 @@ class AndroidNetworkLibrary {
* Adds a cryptographic file (User certificate, a CA certificate or
* PKCS#12 keychain) through the system's CertInstaller activity.
*
- * @param context: current application context.
- * @param cert_type: cryptographic file type. E.g. CertificateMimeType.X509_USER_CERT
- * @param data: certificate/keychain data bytes.
+ * @param context current application context.
+ * @param certType cryptographic file type. E.g. CertificateMimeType.X509_USER_CERT
+ * @param data certificate/keychain data bytes.
* @return true on success, false on failure.
*
* Note that failure only indicates that the function couldn't launch the
@@ -75,24 +75,24 @@ class AndroidNetworkLibrary {
* installed to the keystore.
*/
@CalledByNative
- static public boolean storeCertificate(Context context, int cert_type, byte[] data) {
+ public static boolean storeCertificate(Context context, int certType, byte[] data) {
try {
Intent intent = KeyChain.createInstallIntent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- switch (cert_type) {
- case CertificateMimeType.X509_USER_CERT:
- case CertificateMimeType.X509_CA_CERT:
- intent.putExtra(KeyChain.EXTRA_CERTIFICATE, data);
- break;
+ switch (certType) {
+ case CertificateMimeType.X509_USER_CERT:
+ case CertificateMimeType.X509_CA_CERT:
+ intent.putExtra(KeyChain.EXTRA_CERTIFICATE, data);
+ break;
- case CertificateMimeType.PKCS12_ARCHIVE:
- intent.putExtra(KeyChain.EXTRA_PKCS12, data);
- break;
+ case CertificateMimeType.PKCS12_ARCHIVE:
+ intent.putExtra(KeyChain.EXTRA_PKCS12, data);
+ break;
- default:
- Log.w(TAG, "invalid certificate type: " + cert_type);
- return false;
+ default:
+ Log.w(TAG, "invalid certificate type: " + certType);
+ return false;
}
context.startActivity(intent);
return true;
@@ -107,7 +107,7 @@ class AndroidNetworkLibrary {
* extension. Returns null if no corresponding mime type exists.
*/
@CalledByNative
- static public String getMimeTypeFromExtension(String extension) {
+ public static String getMimeTypeFromExtension(String extension) {
return URLConnection.guessContentTypeFromName("foo." + extension);
}
@@ -117,7 +117,7 @@ class AndroidNetworkLibrary {
* returns false if it cannot determine this.
*/
@CalledByNative
- static public boolean haveOnlyLoopbackAddresses() {
+ public static boolean haveOnlyLoopbackAddresses() {
Enumeration<NetworkInterface> list = null;
try {
list = NetworkInterface.getNetworkInterfaces();
@@ -148,7 +148,7 @@ class AndroidNetworkLibrary {
* represents a network list string with two items.
*/
@CalledByNative
- static public String getNetworkList() {
+ public static String getNetworkList() {
Enumeration<NetworkInterface> list = null;
try {
list = NetworkInterface.getNetworkInterfaces();
« no previous file with comments | « net/android/java/src/org/chromium/net/AndroidKeyStore.java ('k') | net/android/java/src/org/chromium/net/GURLUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698