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
This commit is contained in:
Chris Brody 2020-06-16 19:26:48 -04:00 committed by GitHub
parent 6b789c57e8
commit 80b7a7f6ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 49 additions and 49 deletions

View File

@ -36,7 +36,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest {
public CordovaClientCertRequest(ClientCertRequest request) { public CordovaClientCertRequest(ClientCertRequest request) {
this.request = request; this.request = request;
} }
/** /**
* Cancel this request * Cancel this request
*/ */
@ -45,7 +45,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest {
{ {
request.cancel(); request.cancel();
} }
/* /*
* Returns the host name of the server requesting the certificate. * Returns the host name of the server requesting the certificate.
*/ */
@ -54,7 +54,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest {
{ {
return request.getHost(); return request.getHost();
} }
/* /*
* Returns the acceptable types of asymmetric keys (can be null). * Returns the acceptable types of asymmetric keys (can be null).
*/ */
@ -63,7 +63,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest {
{ {
return request.getKeyTypes(); return request.getKeyTypes();
} }
/* /*
* Returns the port number of the server requesting the certificate. * Returns the port number of the server requesting the certificate.
*/ */
@ -72,7 +72,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest {
{ {
return request.getPort(); return request.getPort();
} }
/* /*
* Returns the acceptable certificate issuers for the certificate matching the private key (can be null). * 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(); return request.getPrincipals();
} }
/* /*
* Ignore the request for now. Do not remember user's choice. * Ignore the request for now. Do not remember user's choice.
*/ */
@ -90,12 +90,12 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest {
{ {
request.ignore(); request.ignore();
} }
/* /*
* Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests. * 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 privateKey The privateKey
* @param chain The certificate chain * @param chain The certificate chain
*/ */
@SuppressLint("NewApi") @SuppressLint("NewApi")
public void proceed(PrivateKey privateKey, X509Certificate[] chain) public void proceed(PrivateKey privateKey, X509Certificate[] chain)

View File

@ -31,17 +31,17 @@ public class CordovaHttpAuthHandler implements ICordovaHttpAuthHandler {
public CordovaHttpAuthHandler(HttpAuthHandler handler) { public CordovaHttpAuthHandler(HttpAuthHandler handler) {
this.handler = handler; this.handler = handler;
} }
/** /**
* Instructs the WebView to cancel the authentication request. * Instructs the WebView to cancel the authentication request.
*/ */
public void cancel () { public void cancel () {
this.handler.cancel(); this.handler.cancel();
} }
/** /**
* Instructs the WebView to proceed with the authentication with the given credentials. * Instructs the WebView to proceed with the authentication with the given credentials.
* *
* @param username * @param username
* @param password * @param password
*/ */

View File

@ -73,7 +73,7 @@ public interface CordovaInterface {
* @return Object or null * @return Object or null
*/ */
public Object onMessage(String id, Object data); public Object onMessage(String id, Object data);
/** /**
* Returns a shared thread pool that can be used for background tasks. * Returns a shared thread pool that can be used for background tasks.
*/ */

View File

@ -47,11 +47,11 @@ public class CordovaPreferences {
public void set(String name, int value) { public void set(String name, int value) {
set(name, "" + value); set(name, "" + value);
} }
public void set(String name, double value) { public void set(String name, double value) {
set(name, "" + value); set(name, "" + value);
} }
public Map<String, String> getAll() { public Map<String, String> getAll() {
return prefs; return prefs;
} }

View File

@ -77,7 +77,7 @@ public class CordovaResourceApi {
public static final String PLUGIN_URI_SCHEME = "cdvplugin"; public static final String PLUGIN_URI_SCHEME = "cdvplugin";
private static final String[] LOCAL_FILE_PROJECTION = { "_data" }; private static final String[] LOCAL_FILE_PROJECTION = { "_data" };
public static Thread jsThread; public static Thread jsThread;
private final AssetManager assetManager; private final AssetManager assetManager;
@ -91,7 +91,7 @@ public class CordovaResourceApi {
this.assetManager = context.getAssets(); this.assetManager = context.getAssets();
this.pluginManager = pluginManager; this.pluginManager = pluginManager;
} }
public void setThreadCheckingEnabled(boolean value) { public void setThreadCheckingEnabled(boolean value) {
threadCheckingEnabled = value; threadCheckingEnabled = value;
} }
@ -99,8 +99,8 @@ public class CordovaResourceApi {
public boolean isThreadCheckingEnabled() { public boolean isThreadCheckingEnabled() {
return threadCheckingEnabled; return threadCheckingEnabled;
} }
public static int getUriType(Uri uri) { public static int getUriType(Uri uri) {
assertNonRelative(uri); assertNonRelative(uri);
String scheme = uri.getScheme(); String scheme = uri.getScheme();
@ -130,7 +130,7 @@ public class CordovaResourceApi {
} }
return URI_TYPE_UNKNOWN; return URI_TYPE_UNKNOWN;
} }
public Uri remapUri(Uri uri) { public Uri remapUri(Uri uri) {
assertNonRelative(uri); assertNonRelative(uri);
Uri pluginUri = pluginManager.remapUri(uri); Uri pluginUri = pluginManager.remapUri(uri);
@ -140,7 +140,7 @@ public class CordovaResourceApi {
public String remapPath(String path) { public String remapPath(String path) {
return remapUri(Uri.fromFile(new File(path))).getPath(); return remapUri(Uri.fromFile(new File(path))).getPath();
} }
/** /**
* Returns a File that points to the resource, or null if the resource * Returns a File that points to the resource, or null if the resource
* is not on the local filesystem. * is not on the local filesystem.
@ -170,7 +170,7 @@ public class CordovaResourceApi {
} }
return null; return null;
} }
public String getMimeType(Uri uri) { public String getMimeType(Uri uri) {
switch (getUriType(uri)) { switch (getUriType(uri)) {
case URI_TYPE_FILE: case URI_TYPE_FILE:
@ -197,11 +197,11 @@ public class CordovaResourceApi {
} }
} }
} }
return null; return null;
} }
//This already exists //This already exists
private String getMimeTypeFromPath(String path) { private String getMimeTypeFromPath(String path) {
String extension = path; String extension = path;
@ -219,7 +219,7 @@ public class CordovaResourceApi {
} }
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
} }
/** /**
* Opens a stream to the given URI, also providing the MIME type & length. * Opens a stream to the given URI, also providing the MIME type & length.
* @return Never returns null. * @return Never returns null.
@ -342,7 +342,7 @@ public class CordovaResourceApi {
assertBackgroundThread(); assertBackgroundThread();
return (HttpURLConnection)new URL(uri.toString()).openConnection(); return (HttpURLConnection)new URL(uri.toString()).openConnection();
} }
// Copies the input to the output in the most efficient manner possible. // Copies the input to the output in the most efficient manner possible.
// Closes both streams. // Closes both streams.
public void copyResource(OpenForReadResult input, OutputStream outputStream) throws IOException { public void copyResource(OpenForReadResult input, OutputStream outputStream) throws IOException {
@ -364,16 +364,16 @@ public class CordovaResourceApi {
} else { } else {
final int BUFFER_SIZE = 8192; final int BUFFER_SIZE = 8192;
byte[] buffer = new byte[BUFFER_SIZE]; byte[] buffer = new byte[BUFFER_SIZE];
for (;;) { for (;;) {
int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE); int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE);
if (bytesRead <= 0) { if (bytesRead <= 0) {
break; break;
} }
outputStream.write(buffer, 0, bytesRead); outputStream.write(buffer, 0, bytesRead);
} }
} }
} finally { } finally {
input.inputStream.close(); input.inputStream.close();
if (outputStream != null) { if (outputStream != null) {
@ -390,7 +390,7 @@ public class CordovaResourceApi {
public void copyResource(Uri sourceUri, Uri dstUri) throws IOException { public void copyResource(Uri sourceUri, Uri dstUri) throws IOException {
copyResource(openForRead(sourceUri), openOutputStream(dstUri)); copyResource(openForRead(sourceUri), openOutputStream(dstUri));
} }
private void assertBackgroundThread() { private void assertBackgroundThread() {
if (threadCheckingEnabled) { if (threadCheckingEnabled) {
Thread curThread = Thread.currentThread(); Thread curThread = Thread.currentThread();
@ -402,7 +402,7 @@ public class CordovaResourceApi {
} }
} }
} }
private String getDataUriMimeType(Uri uri) { private String getDataUriMimeType(Uri uri) {
String uriAsString = uri.getSchemeSpecificPart(); String uriAsString = uri.getSchemeSpecificPart();
int commaPos = uriAsString.indexOf(','); int commaPos = uriAsString.indexOf(',');
@ -447,20 +447,20 @@ public class CordovaResourceApi {
InputStream inputStream = new ByteArrayInputStream(data); InputStream inputStream = new ByteArrayInputStream(data);
return new OpenForReadResult(uri, inputStream, contentType, data.length, null); return new OpenForReadResult(uri, inputStream, contentType, data.length, null);
} }
private static void assertNonRelative(Uri uri) { private static void assertNonRelative(Uri uri) {
if (!uri.isAbsolute()) { if (!uri.isAbsolute()) {
throw new IllegalArgumentException("Relative URIs are not supported."); throw new IllegalArgumentException("Relative URIs are not supported.");
} }
} }
public static final class OpenForReadResult { public static final class OpenForReadResult {
public final Uri uri; public final Uri uri;
public final InputStream inputStream; public final InputStream inputStream;
public final String mimeType; public final String mimeType;
public final long length; public final long length;
public final AssetFileDescriptor assetFd; public final AssetFileDescriptor assetFd;
public OpenForReadResult(Uri uri, InputStream inputStream, String mimeType, long length, AssetFileDescriptor assetFd) { public OpenForReadResult(Uri uri, InputStream inputStream, String mimeType, long length, AssetFileDescriptor assetFd) {
this.uri = uri; this.uri = uri;
this.inputStream = inputStream; this.inputStream = inputStream;

View File

@ -30,37 +30,37 @@ public interface ICordovaClientCertRequest {
* Cancel this request * Cancel this request
*/ */
public void cancel(); public void cancel();
/* /*
* Returns the host name of the server requesting the certificate. * Returns the host name of the server requesting the certificate.
*/ */
public String getHost(); public String getHost();
/* /*
* Returns the acceptable types of asymmetric keys (can be null). * Returns the acceptable types of asymmetric keys (can be null).
*/ */
public String[] getKeyTypes(); public String[] getKeyTypes();
/* /*
* Returns the port number of the server requesting the certificate. * Returns the port number of the server requesting the certificate.
*/ */
public int getPort(); public int getPort();
/* /*
* Returns the acceptable certificate issuers for the certificate matching the private key (can be null). * Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
*/ */
public Principal[] getPrincipals(); public Principal[] getPrincipals();
/* /*
* Ignore the request for now. Do not remember user's choice. * Ignore the request for now. Do not remember user's choice.
*/ */
public void ignore(); 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. * 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 privateKey The privateKey
* @param chain The certificate chain * @param chain The certificate chain
*/ */
public void proceed(PrivateKey privateKey, X509Certificate[] chain); public void proceed(PrivateKey privateKey, X509Certificate[] chain);
} }

View File

@ -27,10 +27,10 @@ package org.apache.cordova;
* Instructs the WebView to cancel the authentication request. * Instructs the WebView to cancel the authentication request.
*/ */
public void cancel (); public void cancel ();
/** /**
* Instructs the WebView to proceed with the authentication with the given credentials. * Instructs the WebView to proceed with the authentication with the given credentials.
* *
* @param username The user name * @param username The user name
* @param password The password * @param password The password
*/ */

View File

@ -82,7 +82,7 @@ public class PluginResult {
this.messageType = binaryString ? MESSAGE_TYPE_BINARYSTRING : MESSAGE_TYPE_ARRAYBUFFER; this.messageType = binaryString ? MESSAGE_TYPE_BINARYSTRING : MESSAGE_TYPE_ARRAYBUFFER;
this.encodedMessage = Base64.encodeToString(data, Base64.NO_WRAP); this.encodedMessage = Base64.encodeToString(data, Base64.NO_WRAP);
} }
// The keepCallback and status of multipartMessages are ignored. // The keepCallback and status of multipartMessages are ignored.
public PluginResult(Status status, List<PluginResult> multipartMessages) { public PluginResult(Status status, List<PluginResult> multipartMessages) {
this.status = status.ordinal(); this.status = status.ordinal();

View File

@ -48,7 +48,7 @@ import java.util.Hashtable;
/** /**
* This class is the WebViewClient that implements callbacks for our web view. * 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 * 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 * shouldOverrideUrlLoading(), etc. Related to but different than
* CordovaChromeClient. * CordovaChromeClient.
*/ */
@ -104,7 +104,7 @@ public class SystemWebViewClient extends WebViewClient {
// By default handle 401 like we'd normally do! // By default handle 401 like we'd normally do!
super.onReceivedHttpAuthRequest(view, handler, host, realm); super.onReceivedHttpAuthRequest(view, handler, host, realm);
} }
/** /**
* On received client cert request. * On received client cert request.
* The method forwards the request to any running plugins before using the default implementation. * The method forwards the request to any running plugins before using the default implementation.

View File

@ -113,7 +113,7 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
//sometimes this can be called after calling webview.destroy() on destroy() //sometimes this can be called after calling webview.destroy() on destroy()
//thus resulting in a NullPointerException //thus resulting in a NullPointerException
if(webView!=null) { if(webView!=null) {
webView.setNetworkAvailable(value); webView.setNetworkAvailable(value);
} }
} }
@Override @Override