From 19da06ec29c0f6d6dba1e327fab7d7a787816047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AA=E3=82=B9?= Date: Sun, 29 Dec 2024 14:42:07 +0900 Subject: [PATCH] refactor: cleanup typos --- framework/cordova.gradle | 2 +- .../src/org/apache/cordova/CallbackMap.java | 2 +- framework/src/org/apache/cordova/Config.java | 4 ++-- .../org/apache/cordova/CordovaActivity.java | 10 +++++----- .../src/org/apache/cordova/CordovaPlugin.java | 8 ++++---- .../src/org/apache/cordova/CordovaWebView.java | 6 +++--- .../apache/cordova/CordovaWebViewEngine.java | 2 +- .../org/apache/cordova/CordovaWebViewImpl.java | 18 +++++++++--------- .../src/org/apache/cordova/CoreAndroid.java | 10 +++++----- .../apache/cordova/NativeToJsMessageQueue.java | 6 +++--- .../src/org/apache/cordova/PluginManager.java | 14 +++++++------- .../cordova/engine/SystemWebChromeClient.java | 6 +++--- .../cordova/engine/SystemWebViewClient.java | 4 ++-- .../cordova/engine/SystemWebViewEngine.java | 18 +++++++++--------- 14 files changed, 55 insertions(+), 55 deletions(-) diff --git a/framework/cordova.gradle b/framework/cordova.gradle index 9b978398..abb5b411 100644 --- a/framework/cordova.gradle +++ b/framework/cordova.gradle @@ -150,7 +150,7 @@ def doGetConfigPreference(name, defaultValue) { } def doApplyCordovaConfigCustomization() { - // Apply user overide properties that comes from the "--gradleArg=-P" parameters + // Apply user override properties that comes from the "--gradleArg=-P" parameters if (project.hasProperty('cdvMinSdkVersion')) { cordovaConfig.MIN_SDK_VERSION = Integer.parseInt('' + cdvMinSdkVersion) } diff --git a/framework/src/org/apache/cordova/CallbackMap.java b/framework/src/org/apache/cordova/CallbackMap.java index b2f82aa7..5551d13c 100644 --- a/framework/src/org/apache/cordova/CallbackMap.java +++ b/framework/src/org/apache/cordova/CallbackMap.java @@ -54,7 +54,7 @@ public class CallbackMap { * obtained from registerCallback() * * @param mappedId The request code obtained from registerCallback() - * @return The CordovaPlugin and orignal request code that correspond to the + * @return The CordovaPlugin and original request code that correspond to the * given mappedCode */ public synchronized Pair getAndRemoveCallback(int mappedId) { diff --git a/framework/src/org/apache/cordova/Config.java b/framework/src/org/apache/cordova/Config.java index 238cd5e3..4fdcc952 100644 --- a/framework/src/org/apache/cordova/Config.java +++ b/framework/src/org/apache/cordova/Config.java @@ -23,7 +23,7 @@ import java.util.List; import android.app.Activity; -@Deprecated // Use AllowList, CordovaPrefences, etc. directly. +@Deprecated // Use AllowList, CordovaPreferences, etc. directly. public class Config { private static final String TAG = "Config"; @@ -54,7 +54,7 @@ public class Config { } public static String getErrorUrl() { - return parser.getPreferences().getString("errorurl", null); + return parser.getPreferences().getString("ErrorUrl", null); } public static List getPluginEntries() { diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index 503e5c1a..4bb6dc63 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -78,7 +78,7 @@ import androidx.core.splashscreen.SplashScreen; public class CordovaActivity extends AppCompatActivity { public static final String TAG = "CordovaActivity"; - // The webview for our app + // The WebView for our app protected CordovaWebView appView; private static final int ACTIVITY_STARTING = 0; @@ -112,7 +112,7 @@ public class CordovaActivity extends AppCompatActivity { // need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception loadConfig(); - String logLevel = preferences.getString("loglevel", "ERROR"); + String logLevel = preferences.getString("LogLevel", "ERROR"); LOG.setLogLevel(logLevel); LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting"); @@ -206,7 +206,7 @@ public class CordovaActivity extends AppCompatActivity { /** * Construct the default web view object. *

- * Override this to customize the webview that is used. + * Override this to customize the WebView that is used. */ protected CordovaWebView makeWebView() { return new CordovaWebViewImpl(makeWebViewEngine()); @@ -227,7 +227,7 @@ public class CordovaActivity extends AppCompatActivity { } /** - * Load the url into the webview. + * Load the url into the WebView. */ public void loadUrl(String url) { if (appView == null) { @@ -250,7 +250,7 @@ public class CordovaActivity extends AppCompatActivity { if (this.appView != null) { // CB-9382 If there is an activity that started for result and main activity is waiting for callback - // result, we shoudn't stop WebView Javascript timers, as activity for result might be using them + // result, we shouldn't stop WebView Javascript timers, as activity for result might be using them boolean keepRunning = this.keepRunning || this.cordovaInterface.activityResultCallback != null; this.appView.handlePause(keepRunning); } diff --git a/framework/src/org/apache/cordova/CordovaPlugin.java b/framework/src/org/apache/cordova/CordovaPlugin.java index 7046b733..d667c609 100644 --- a/framework/src/org/apache/cordova/CordovaPlugin.java +++ b/framework/src/org/apache/cordova/CordovaPlugin.java @@ -244,7 +244,7 @@ public class CordovaPlugin { /** * Hook for blocking navigation by the Cordova WebView. This applies both to top-level and - * iframe navigations. + * iframe navigation. * * This will be called when the WebView's needs to know whether to navigate * to a new page. Return false to block the navigation: if any plugin @@ -282,7 +282,7 @@ public class CordovaPlugin { /** * Allows plugins to handle a link being clicked. Return true here to cancel the navigation. * - * @param url The URL that is trying to be loaded in the Cordova webview. + * @param url The URL that is trying to be loaded in the Cordova WebView. * @return true to prevent the URL from loading. Default is false. */ public boolean onOverrideUrlLoading(String url) { @@ -439,11 +439,11 @@ public class CordovaPlugin { } /** - * Called when the WebView's render process has exited. Can be used to collect information regarding the crash for crashlytics or optionally attempt to gracefully handle/recover the crashed webview by recreating it. + * Called when the WebView's render process has exited. Can be used to collect information regarding the crash for crashlytics or optionally attempt to gracefully handle/recover the crashed WebView by recreating it. * * See WebViewClient#onRenderProcessGone * - * Note: A plugin must not attempt to recover a webview that it does not own/manage. + * Note: A plugin must not attempt to recover a WebView that it does not own/manage. * * @return true if the host application handled the situation that process has exited, * otherwise, application will crash if render process crashed, or be killed diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index f6a19069..fd8ce0f6 100644 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -25,7 +25,7 @@ import android.view.View; import android.webkit.WebChromeClient.CustomViewCallback; /** - * Main interface for interacting with a Cordova webview - implemented by CordovaWebViewImpl. + * Main interface for interacting with a Cordova WebView - implemented by CordovaWebViewImpl. * This is an interface so that it can be easily mocked in tests. * Methods may be added to this interface without a major version bump, as plugins & embedders * are not expected to implement it. @@ -92,12 +92,12 @@ public interface CordovaWebView { void sendJavascript(String statememt); /** - * Load the specified URL in the Cordova webview or a new browser instance. + * Load the specified URL in the Cordova WebView or a new browser instance. * * NOTE: If openExternal is false, only allow listed URLs can be loaded. * * @param url The url to load. - * @param openExternal Load url in browser instead of Cordova webview. + * @param openExternal Load url in browser instead of Cordova WebView. * @param clearHistory Clear the history stack, so new page becomes top of history * @param params Parameters for new app */ diff --git a/framework/src/org/apache/cordova/CordovaWebViewEngine.java b/framework/src/org/apache/cordova/CordovaWebViewEngine.java index b73461b9..3e0d8bf6 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewEngine.java +++ b/framework/src/org/apache/cordova/CordovaWebViewEngine.java @@ -59,7 +59,7 @@ public interface CordovaWebViewEngine { /** Clean up all resources associated with the WebView. */ void destroy(); - /** Add the evaulate Javascript method **/ + /** Add the evaluate Javascript method **/ void evaluateJavascript(String js, ValueCallback callback); /** diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java index 08648aaa..db4d9531 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewImpl.java +++ b/framework/src/org/apache/cordova/CordovaWebViewImpl.java @@ -43,7 +43,7 @@ import java.util.Map; import java.util.Set; /** - * Main class for interacting with a Cordova webview. Manages plugins, events, and a CordovaWebViewEngine. + * Main class for interacting with a Cordova WebView. Manages plugins, events, and a CordovaWebViewEngine. * Class uses two-phase initialization. You must call init() before calling any other methods. */ public class CordovaWebViewImpl implements CordovaWebView { @@ -75,13 +75,13 @@ public class CordovaWebViewImpl implements CordovaWebView { private final Set boundKeyCodes = new HashSet<>(); public static CordovaWebViewEngine createEngine(Context context, CordovaPreferences preferences) { - String className = preferences.getString("webview", SystemWebViewEngine.class.getCanonicalName()); + String className = preferences.getString("WebView", SystemWebViewEngine.class.getCanonicalName()); try { Class webViewClass = Class.forName(className); Constructor constructor = webViewClass.getConstructor(Context.class, CordovaPreferences.class); return (CordovaWebViewEngine) constructor.newInstance(context, preferences); } catch (Exception e) { - throw new RuntimeException("Failed to create webview. ", e); + throw new RuntimeException("Failed to create WebView. ", e); } } @@ -152,7 +152,7 @@ public class CordovaWebViewImpl implements CordovaWebView { stopLoading(); LOG.e(TAG, "CordovaWebView: TIMEOUT ERROR!"); - // Handle other errors by passing them to the webview in JS + // Handle other errors by passing them to the WebView in JS JSONObject data = new JSONObject(); try { data.put("errorCode", -6); @@ -213,7 +213,7 @@ public class CordovaWebViewImpl implements CordovaWebView { engine.clearHistory(); } - // If loading into our webview + // If loading into our WebView if (!openExternal) { // Make sure url is in allow list if (pluginManager.shouldAllowNavigation(url)) { @@ -222,7 +222,7 @@ public class CordovaWebViewImpl implements CordovaWebView { loadUrlIntoView(url, true); return; } else { - LOG.w(TAG, "showWebPage: Refusing to load URL into webview since it is not in the allow list. URL=" + url); + LOG.w(TAG, "showWebPage: Refusing to load URL into WebView since it is not in the allow list. URL=" + url); return; } } @@ -481,7 +481,7 @@ public class CordovaWebViewImpl implements CordovaWebView { // If app doesn't want to run in background if (!keepRunning) { - // Pause JavaScript timers. This affects all webviews within the app! + // Pause JavaScript timers. This affects all WebViews within the app! engine.setPaused(true); } } @@ -491,7 +491,7 @@ public class CordovaWebViewImpl implements CordovaWebView { return; } - // Resume JavaScript timers. This affects all webviews within the app! + // Resume JavaScript timers. This affects all WebViews within the app! engine.setPaused(false); this.pluginManager.onResume(keepRunning); @@ -531,7 +531,7 @@ public class CordovaWebViewImpl implements CordovaWebView { // We should use a blank data: url instead so it's more obvious this.loadUrl("about:blank"); - // TODO: Should not destroy webview until after about:blank is done loading. + // TODO: Should not destroy WebView until after about:blank is done loading. engine.destroy(); hideCustomView(); } diff --git a/framework/src/org/apache/cordova/CoreAndroid.java b/framework/src/org/apache/cordova/CoreAndroid.java index 2e39a786..a55f1053 100755 --- a/framework/src/org/apache/cordova/CoreAndroid.java +++ b/framework/src/org/apache/cordova/CoreAndroid.java @@ -67,7 +67,7 @@ public class CoreAndroid extends CordovaPlugin { * Executes the request and returns PluginResult. * * @param action The action to execute. - * @param args JSONArry of arguments for the plugin. + * @param args JSONArray of arguments for the plugin. * @param callbackContext The callback context from which we were invoked. * * @return A PluginResult object with a status and message. @@ -82,9 +82,9 @@ public class CoreAndroid extends CordovaPlugin { this.clearCache(); } else if (action.equals("show")) { - // This gets called from JavaScript onCordovaReady to show the webview. + // This gets called from JavaScript onCordovaReady to show the WebView. // I recommend we change the name of the Message as spinner/stop is not - // indicative of what this actually does (shows the webview). + // indicative of what this actually does (shows the WebView). cordova.getActivity().runOnUiThread(() -> webView.getPluginManager().postMessage("spinner", "stop")); } else if (action.equals("loadUrl")) { @@ -143,7 +143,7 @@ public class CoreAndroid extends CordovaPlugin { } /** - * Load the url into the webview. + * Load the url into the WebView. * * @param url * @param props Properties that can be passed in to the Cordova activity (i.e. loadingDialog, wait, ...) @@ -273,7 +273,7 @@ public class CoreAndroid extends CordovaPlugin { private void initTelephonyReceiver() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED); - //final CordovaInterface mycordova = this.cordova; + //final CordovaInterface myCordova = this.cordova; this.telephonyReceiver = new BroadcastReceiver() { @Override diff --git a/framework/src/org/apache/cordova/NativeToJsMessageQueue.java b/framework/src/org/apache/cordova/NativeToJsMessageQueue.java index c687a955..8ec8e336 100755 --- a/framework/src/org/apache/cordova/NativeToJsMessageQueue.java +++ b/framework/src/org/apache/cordova/NativeToJsMessageQueue.java @@ -491,9 +491,9 @@ public class NativeToJsMessageQueue { case PluginResult.MESSAGE_TYPE_MULTIPART: int size = pluginResult.getMultipartMessagesSize(); for (int i=0; i