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) {
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)

View File

@ -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
*/

View File

@ -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.
*/

View File

@ -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<String, String> getAll() {
return prefs;
}

View File

@ -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;

View File

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

View File

@ -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
*/

View File

@ -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<PluginResult> multipartMessages) {
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.
* 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.

View File

@ -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