From 80b7a7f6acb43dfc2dfd4fd87261052496f37756 Mon Sep 17 00:00:00 2001 From: Chris Brody Date: Tue, 16 Jun 2020 19:26:48 -0400 Subject: [PATCH] cleanup: remove trailing spaces from Java sources (#999) * remove trailing spaces from framework/src/org/apache/cordova/*.java * remove trailing spaces from framework/src/org/apache/cordova/engine/*.java --- .../cordova/CordovaClientCertRequest.java | 18 ++++----- .../cordova/CordovaHttpAuthHandler.java | 6 +-- .../org/apache/cordova/CordovaInterface.java | 2 +- .../apache/cordova/CordovaPreferences.java | 4 +- .../apache/cordova/CordovaResourceApi.java | 40 +++++++++---------- .../cordova/ICordovaClientCertRequest.java | 16 ++++---- .../cordova/ICordovaHttpAuthHandler.java | 4 +- .../src/org/apache/cordova/PluginResult.java | 2 +- .../cordova/engine/SystemWebViewClient.java | 4 +- .../cordova/engine/SystemWebViewEngine.java | 2 +- 10 files changed, 49 insertions(+), 49 deletions(-) diff --git a/framework/src/org/apache/cordova/CordovaClientCertRequest.java b/framework/src/org/apache/cordova/CordovaClientCertRequest.java index ccda0272..ad7c588a 100644 --- a/framework/src/org/apache/cordova/CordovaClientCertRequest.java +++ b/framework/src/org/apache/cordova/CordovaClientCertRequest.java @@ -36,7 +36,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest { public CordovaClientCertRequest(ClientCertRequest request) { this.request = request; } - + /** * Cancel this request */ @@ -45,7 +45,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest { { request.cancel(); } - + /* * Returns the host name of the server requesting the certificate. */ @@ -54,7 +54,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest { { return request.getHost(); } - + /* * Returns the acceptable types of asymmetric keys (can be null). */ @@ -63,7 +63,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest { { return request.getKeyTypes(); } - + /* * Returns the port number of the server requesting the certificate. */ @@ -72,7 +72,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest { { return request.getPort(); } - + /* * Returns the acceptable certificate issuers for the certificate matching the private key (can be null). */ @@ -81,7 +81,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest { { return request.getPrincipals(); } - + /* * Ignore the request for now. Do not remember user's choice. */ @@ -90,12 +90,12 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest { { request.ignore(); } - + /* * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests. - * + * * @param privateKey The privateKey - * @param chain The certificate chain + * @param chain The certificate chain */ @SuppressLint("NewApi") public void proceed(PrivateKey privateKey, X509Certificate[] chain) diff --git a/framework/src/org/apache/cordova/CordovaHttpAuthHandler.java b/framework/src/org/apache/cordova/CordovaHttpAuthHandler.java index 724381e2..a2692f8c 100644 --- a/framework/src/org/apache/cordova/CordovaHttpAuthHandler.java +++ b/framework/src/org/apache/cordova/CordovaHttpAuthHandler.java @@ -31,17 +31,17 @@ public class CordovaHttpAuthHandler implements ICordovaHttpAuthHandler { public CordovaHttpAuthHandler(HttpAuthHandler handler) { this.handler = handler; } - + /** * Instructs the WebView to cancel the authentication request. */ public void cancel () { this.handler.cancel(); } - + /** * Instructs the WebView to proceed with the authentication with the given credentials. - * + * * @param username * @param password */ diff --git a/framework/src/org/apache/cordova/CordovaInterface.java b/framework/src/org/apache/cordova/CordovaInterface.java index ff906834..7661b742 100755 --- a/framework/src/org/apache/cordova/CordovaInterface.java +++ b/framework/src/org/apache/cordova/CordovaInterface.java @@ -73,7 +73,7 @@ public interface CordovaInterface { * @return Object or null */ public Object onMessage(String id, Object data); - + /** * Returns a shared thread pool that can be used for background tasks. */ diff --git a/framework/src/org/apache/cordova/CordovaPreferences.java b/framework/src/org/apache/cordova/CordovaPreferences.java index 4dbc93e6..96c219c9 100644 --- a/framework/src/org/apache/cordova/CordovaPreferences.java +++ b/framework/src/org/apache/cordova/CordovaPreferences.java @@ -47,11 +47,11 @@ public class CordovaPreferences { public void set(String name, int value) { set(name, "" + value); } - + public void set(String name, double value) { set(name, "" + value); } - + public Map getAll() { return prefs; } diff --git a/framework/src/org/apache/cordova/CordovaResourceApi.java b/framework/src/org/apache/cordova/CordovaResourceApi.java index 3c438e21..8350ec27 100644 --- a/framework/src/org/apache/cordova/CordovaResourceApi.java +++ b/framework/src/org/apache/cordova/CordovaResourceApi.java @@ -77,7 +77,7 @@ public class CordovaResourceApi { public static final String PLUGIN_URI_SCHEME = "cdvplugin"; private static final String[] LOCAL_FILE_PROJECTION = { "_data" }; - + public static Thread jsThread; private final AssetManager assetManager; @@ -91,7 +91,7 @@ public class CordovaResourceApi { this.assetManager = context.getAssets(); this.pluginManager = pluginManager; } - + public void setThreadCheckingEnabled(boolean value) { threadCheckingEnabled = value; } @@ -99,8 +99,8 @@ public class CordovaResourceApi { public boolean isThreadCheckingEnabled() { return threadCheckingEnabled; } - - + + public static int getUriType(Uri uri) { assertNonRelative(uri); String scheme = uri.getScheme(); @@ -130,7 +130,7 @@ public class CordovaResourceApi { } return URI_TYPE_UNKNOWN; } - + public Uri remapUri(Uri uri) { assertNonRelative(uri); Uri pluginUri = pluginManager.remapUri(uri); @@ -140,7 +140,7 @@ public class CordovaResourceApi { public String remapPath(String path) { return remapUri(Uri.fromFile(new File(path))).getPath(); } - + /** * Returns a File that points to the resource, or null if the resource * is not on the local filesystem. @@ -170,7 +170,7 @@ public class CordovaResourceApi { } return null; } - + public String getMimeType(Uri uri) { switch (getUriType(uri)) { case URI_TYPE_FILE: @@ -197,11 +197,11 @@ public class CordovaResourceApi { } } } - + return null; } - - + + //This already exists private String getMimeTypeFromPath(String path) { String extension = path; @@ -219,7 +219,7 @@ public class CordovaResourceApi { } return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); } - + /** * Opens a stream to the given URI, also providing the MIME type & length. * @return Never returns null. @@ -342,7 +342,7 @@ public class CordovaResourceApi { assertBackgroundThread(); return (HttpURLConnection)new URL(uri.toString()).openConnection(); } - + // Copies the input to the output in the most efficient manner possible. // Closes both streams. public void copyResource(OpenForReadResult input, OutputStream outputStream) throws IOException { @@ -364,16 +364,16 @@ public class CordovaResourceApi { } else { final int BUFFER_SIZE = 8192; byte[] buffer = new byte[BUFFER_SIZE]; - + for (;;) { int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE); - + if (bytesRead <= 0) { break; } outputStream.write(buffer, 0, bytesRead); } - } + } } finally { input.inputStream.close(); if (outputStream != null) { @@ -390,7 +390,7 @@ public class CordovaResourceApi { public void copyResource(Uri sourceUri, Uri dstUri) throws IOException { copyResource(openForRead(sourceUri), openOutputStream(dstUri)); } - + private void assertBackgroundThread() { if (threadCheckingEnabled) { Thread curThread = Thread.currentThread(); @@ -402,7 +402,7 @@ public class CordovaResourceApi { } } } - + private String getDataUriMimeType(Uri uri) { String uriAsString = uri.getSchemeSpecificPart(); int commaPos = uriAsString.indexOf(','); @@ -447,20 +447,20 @@ public class CordovaResourceApi { InputStream inputStream = new ByteArrayInputStream(data); return new OpenForReadResult(uri, inputStream, contentType, data.length, null); } - + private static void assertNonRelative(Uri uri) { if (!uri.isAbsolute()) { throw new IllegalArgumentException("Relative URIs are not supported."); } } - + public static final class OpenForReadResult { public final Uri uri; public final InputStream inputStream; public final String mimeType; public final long length; public final AssetFileDescriptor assetFd; - + public OpenForReadResult(Uri uri, InputStream inputStream, String mimeType, long length, AssetFileDescriptor assetFd) { this.uri = uri; this.inputStream = inputStream; diff --git a/framework/src/org/apache/cordova/ICordovaClientCertRequest.java b/framework/src/org/apache/cordova/ICordovaClientCertRequest.java index 455d2f9d..1417a156 100644 --- a/framework/src/org/apache/cordova/ICordovaClientCertRequest.java +++ b/framework/src/org/apache/cordova/ICordovaClientCertRequest.java @@ -30,37 +30,37 @@ public interface ICordovaClientCertRequest { * Cancel this request */ public void cancel(); - + /* * Returns the host name of the server requesting the certificate. */ public String getHost(); - + /* * Returns the acceptable types of asymmetric keys (can be null). */ public String[] getKeyTypes(); - + /* * Returns the port number of the server requesting the certificate. */ public int getPort(); - + /* * Returns the acceptable certificate issuers for the certificate matching the private key (can be null). */ public Principal[] getPrincipals(); - + /* * Ignore the request for now. Do not remember user's choice. */ public void ignore(); - + /* * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests. - * + * * @param privateKey The privateKey - * @param chain The certificate chain + * @param chain The certificate chain */ public void proceed(PrivateKey privateKey, X509Certificate[] chain); } \ No newline at end of file diff --git a/framework/src/org/apache/cordova/ICordovaHttpAuthHandler.java b/framework/src/org/apache/cordova/ICordovaHttpAuthHandler.java index c55818ac..c89e5b9a 100644 --- a/framework/src/org/apache/cordova/ICordovaHttpAuthHandler.java +++ b/framework/src/org/apache/cordova/ICordovaHttpAuthHandler.java @@ -27,10 +27,10 @@ package org.apache.cordova; * Instructs the WebView to cancel the authentication request. */ public void cancel (); - + /** * Instructs the WebView to proceed with the authentication with the given credentials. - * + * * @param username The user name * @param password The password */ diff --git a/framework/src/org/apache/cordova/PluginResult.java b/framework/src/org/apache/cordova/PluginResult.java index 2b3ac72e..5db60b3b 100644 --- a/framework/src/org/apache/cordova/PluginResult.java +++ b/framework/src/org/apache/cordova/PluginResult.java @@ -82,7 +82,7 @@ public class PluginResult { this.messageType = binaryString ? MESSAGE_TYPE_BINARYSTRING : MESSAGE_TYPE_ARRAYBUFFER; this.encodedMessage = Base64.encodeToString(data, Base64.NO_WRAP); } - + // The keepCallback and status of multipartMessages are ignored. public PluginResult(Status status, List multipartMessages) { this.status = status.ordinal(); diff --git a/framework/src/org/apache/cordova/engine/SystemWebViewClient.java b/framework/src/org/apache/cordova/engine/SystemWebViewClient.java index c51596bb..af9e51f1 100755 --- a/framework/src/org/apache/cordova/engine/SystemWebViewClient.java +++ b/framework/src/org/apache/cordova/engine/SystemWebViewClient.java @@ -48,7 +48,7 @@ import java.util.Hashtable; /** * This class is the WebViewClient that implements callbacks for our web view. * The kind of callbacks that happen here are regarding the rendering of the - * document instead of the chrome surrounding it, such as onPageStarted(), + * document instead of the chrome surrounding it, such as onPageStarted(), * shouldOverrideUrlLoading(), etc. Related to but different than * CordovaChromeClient. */ @@ -104,7 +104,7 @@ public class SystemWebViewClient extends WebViewClient { // By default handle 401 like we'd normally do! super.onReceivedHttpAuthRequest(view, handler, host, realm); } - + /** * On received client cert request. * The method forwards the request to any running plugins before using the default implementation. diff --git a/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java b/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java index 1cbd7f8b..3201c744 100755 --- a/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java +++ b/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java @@ -113,7 +113,7 @@ public class SystemWebViewEngine implements CordovaWebViewEngine { //sometimes this can be called after calling webview.destroy() on destroy() //thus resulting in a NullPointerException if(webView!=null) { - webView.setNetworkAvailable(value); + webView.setNetworkAvailable(value); } } @Override