Skip to content

Commit

Permalink
cleanup: remove trailing spaces from Java sources (#999)
Browse files Browse the repository at this point in the history
* remove trailing spaces from framework/src/org/apache/cordova/*.java
* remove trailing spaces from framework/src/org/apache/cordova/engine/*.java
  • Loading branch information
Chris Brody authored Jun 16, 2020
1 parent 6b789c5 commit 80b7a7f
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 49 deletions.
18 changes: 9 additions & 9 deletions framework/src/org/apache/cordova/CordovaClientCertRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class CordovaClientCertRequest implements ICordovaClientCertRequest {
public CordovaClientCertRequest(ClientCertRequest request) {
this.request = request;
}

/**
* Cancel this request
*/
Expand All @@ -45,7 +45,7 @@ public void cancel()
{
request.cancel();
}

/*
* Returns the host name of the server requesting the certificate.
*/
Expand All @@ -54,7 +54,7 @@ public String getHost()
{
return request.getHost();
}

/*
* Returns the acceptable types of asymmetric keys (can be null).
*/
Expand All @@ -63,7 +63,7 @@ public String[] getKeyTypes()
{
return request.getKeyTypes();
}

/*
* Returns the port number of the server requesting the certificate.
*/
Expand All @@ -72,7 +72,7 @@ public int getPort()
{
return request.getPort();
}

/*
* Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
*/
Expand All @@ -81,7 +81,7 @@ public Principal[] getPrincipals()
{
return request.getPrincipals();
}

/*
* Ignore the request for now. Do not remember user's choice.
*/
Expand All @@ -90,12 +90,12 @@ public void 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.
*
*
* @param privateKey The privateKey
* @param chain The certificate chain
* @param chain The certificate chain
*/
@SuppressLint("NewApi")
public void proceed(PrivateKey privateKey, X509Certificate[] chain)
Expand Down
6 changes: 3 additions & 3 deletions framework/src/org/apache/cordova/CordovaHttpAuthHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion framework/src/org/apache/cordova/CordovaInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
4 changes: 2 additions & 2 deletions framework/src/org/apache/cordova/CordovaPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public void set(String name, boolean value) {
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;
}
Expand Down
40 changes: 20 additions & 20 deletions framework/src/org/apache/cordova/CordovaResourceApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -91,16 +91,16 @@ public CordovaResourceApi(Context context, PluginManager pluginManager) {
this.assetManager = context.getAssets();
this.pluginManager = pluginManager;
}

public void setThreadCheckingEnabled(boolean value) {
threadCheckingEnabled = value;
}

public boolean isThreadCheckingEnabled() {
return threadCheckingEnabled;
}


public static int getUriType(Uri uri) {
assertNonRelative(uri);
String scheme = uri.getScheme();
Expand Down Expand Up @@ -130,7 +130,7 @@ public static int getUriType(Uri uri) {
}
return URI_TYPE_UNKNOWN;
}

public Uri remapUri(Uri uri) {
assertNonRelative(uri);
Uri pluginUri = pluginManager.remapUri(uri);
Expand All @@ -140,7 +140,7 @@ public Uri remapUri(Uri uri) {
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.
Expand Down Expand Up @@ -170,7 +170,7 @@ public File mapUriToFile(Uri uri) {
}
return null;
}

public String getMimeType(Uri uri) {
switch (getUriType(uri)) {
case URI_TYPE_FILE:
Expand All @@ -197,11 +197,11 @@ public String getMimeType(Uri uri) {
}
}
}

return null;
}


//This already exists
private String getMimeTypeFromPath(String path) {
String extension = path;
Expand All @@ -219,7 +219,7 @@ private String getMimeTypeFromPath(String path) {
}
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
}

/**
* Opens a stream to the given URI, also providing the MIME type & length.
* @return Never returns null.
Expand Down Expand Up @@ -342,7 +342,7 @@ public HttpURLConnection createHttpConnection(Uri uri) throws IOException {
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 {
Expand All @@ -364,16 +364,16 @@ public void copyResource(OpenForReadResult input, OutputStream outputStream) thr
} 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) {
Expand All @@ -390,7 +390,7 @@ public void copyResource(Uri sourceUri, OutputStream outputStream) throws IOExce
public void copyResource(Uri sourceUri, Uri dstUri) throws IOException {
copyResource(openForRead(sourceUri), openOutputStream(dstUri));
}

private void assertBackgroundThread() {
if (threadCheckingEnabled) {
Thread curThread = Thread.currentThread();
Expand All @@ -402,7 +402,7 @@ private void assertBackgroundThread() {
}
}
}

private String getDataUriMimeType(Uri uri) {
String uriAsString = uri.getSchemeSpecificPart();
int commaPos = uriAsString.indexOf(',');
Expand Down Expand Up @@ -447,20 +447,20 @@ private OpenForReadResult readDataUri(Uri uri) {
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;
Expand Down
16 changes: 8 additions & 8 deletions framework/src/org/apache/cordova/ICordovaClientCertRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions framework/src/org/apache/cordova/ICordovaHttpAuthHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public interface ICordovaHttpAuthHandler {
* 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
*/
Expand Down
2 changes: 1 addition & 1 deletion framework/src/org/apache/cordova/PluginResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public PluginResult(Status status, byte[] data, boolean binaryString) {
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Licensed to the Apache Software Foundation (ASF) under one
/**
* 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.
*/
Expand Down Expand Up @@ -104,7 +104,7 @@ public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, Str
// 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void setNetworkAvailable(boolean value) {
//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
Expand Down

0 comments on commit 80b7a7f

Please sign in to comment.