Skip to content

Commit eb0f002

Browse files
authored
style: update & resolve doc block warnings (apache#1774)
* style: resolve throw symbols (except InvalidArgumentException) * style: resolve unknown symbol & reduce indention for PluginEntry * fix: define IllegalArgumentException not InvalidArgumentException
1 parent e012478 commit eb0f002

30 files changed

+252
-222
lines changed

cordova-js-src/plugin/android/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ module.exports = {
3131
},
3232

3333
/**
34-
* Load the url into the webview or into new browser instance.
34+
* Load the url into the WebView or into new browser instance.
3535
*
3636
* @param url The URL to load
3737
* @param props Properties that can be passed in to the activity:
3838
* wait: int => wait msec before loading URL
3939
* loadingDialog: "Title,Message" => display a native loading dialog
4040
* loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
41-
* clearHistory: boolean => clear webview history (default=false)
41+
* clearHistory: boolean => clear WebView history (default=false)
4242
* openExternal: boolean => open in a new browser (default=false)
4343
*
4444
* Example:

framework/cordova.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def doGetConfigPreference(name, defaultValue) {
150150
}
151151

152152
def doApplyCordovaConfigCustomization() {
153-
// Apply user overide properties that comes from the "--gradleArg=-P" parameters
153+
// Apply user override properties that comes from the "--gradleArg=-P" parameters
154154
if (project.hasProperty('cdvMinSdkVersion')) {
155155
cordovaConfig.MIN_SDK_VERSION = Integer.parseInt('' + cdvMinSdkVersion)
156156
}

framework/src/org/apache/cordova/AllowListPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class AllowListPlugin extends CordovaPlugin {
3939
// Used when instantiated via reflection by PluginManager
4040
public AllowListPlugin() { }
4141

42-
// These can be used by embedders to allow Java-configuration of an allow list.
42+
// These can be used by plugin developers to allow Java-configuration of an allow list.
4343
public AllowListPlugin(Context context) {
4444
this(new AllowList(), new AllowList(), null);
4545
new CustomConfigXmlParser().parse(context);

framework/src/org/apache/cordova/AuthenticationToken.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public String getUserName() {
3737
/**
3838
* Sets the user name.
3939
*
40-
* @param userName
41-
* the new user name
40+
* @param userName the new user name
4241
*/
4342
public void setUserName(String userName) {
4443
this.userName = userName;
@@ -56,8 +55,7 @@ public String getPassword() {
5655
/**
5756
* Sets the password.
5857
*
59-
* @param password
60-
* the new password
58+
* @param password the new password
6159
*/
6260
public void setPassword(String password) {
6361
this.password = password;

framework/src/org/apache/cordova/CallbackMap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public synchronized int registerCallback(CordovaPlugin receiver, int requestCode
5454
* obtained from registerCallback()
5555
*
5656
* @param mappedId The request code obtained from registerCallback()
57-
* @return The CordovaPlugin and orignal request code that correspond to the
57+
* @return The CordovaPlugin and original request code that correspond to the
5858
* given mappedCode
5959
*/
6060
public synchronized Pair<CordovaPlugin, Integer> getAndRemoveCallback(int mappedId) {

framework/src/org/apache/cordova/Config.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one
2323

2424
import android.app.Activity;
2525

26-
@Deprecated // Use AllowList, CordovaPrefences, etc. directly.
26+
@Deprecated // Use AllowList, CordovaPreferences, etc. directly.
2727
public class Config {
2828
private static final String TAG = "Config";
2929

framework/src/org/apache/cordova/CordovaActivity.java

+9-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Licensed to the Apache Software Foundation (ASF) under one
4949
* application. It should be extended by the user to load the specific
5050
* html file that contains the application.
5151
*
52-
* As an example:
52+
* <p>As an example:</p>
5353
*
5454
* <pre>
5555
* package org.apache.cordova.examples;
@@ -68,17 +68,16 @@ Licensed to the Apache Software Foundation (ASF) under one
6868
* }
6969
* </pre>
7070
*
71-
* Cordova xml configuration: Cordova uses a configuration file at
72-
* res/xml/config.xml to specify its settings. See "The config.xml File"
73-
* guide in cordova-docs at http://cordova.apache.org/docs for the documentation
74-
* for the configuration. The use of the set*Property() methods is
75-
* deprecated in favor of the config.xml file.
71+
* <p>Cordova xml configuration: Cordova uses a configuration file at
72+
* res/xml/config.xml to specify its settings. See the "Config.xml API" documentation for
73+
* configuration details at <a href="https://cordova.apache.org/docs">Apache Cordova Docs</a>.</p>
7674
*
75+
* <p>The use of the set*Property() methods is deprecated in favor of the config.xml file.</p>
7776
*/
7877
public class CordovaActivity extends AppCompatActivity {
7978
public static String TAG = "CordovaActivity";
8079

81-
// The webview for our app
80+
// The WebView for our app
8281
protected CordovaWebView appView;
8382

8483
private static int ACTIVITY_STARTING = 0;
@@ -206,7 +205,7 @@ protected void createViews() {
206205
/**
207206
* Construct the default web view object.
208207
* <p/>
209-
* Override this to customize the webview that is used.
208+
* Override this to customize the WebView that is used.
210209
*/
211210
protected CordovaWebView makeWebView() {
212211
return new CordovaWebViewImpl(makeWebViewEngine());
@@ -227,7 +226,7 @@ public Object onMessage(String id, Object data) {
227226
}
228227

229228
/**
230-
* Load the url into the webview.
229+
* Load the url into the WebView.
231230
*/
232231
public void loadUrl(String url) {
233232
if (appView == null) {
@@ -250,7 +249,7 @@ protected void onPause() {
250249

251250
if (this.appView != null) {
252251
// CB-9382 If there is an activity that started for result and main activity is waiting for callback
253-
// result, we shoudn't stop WebView Javascript timers, as activity for result might be using them
252+
// result, we shouldn't stop WebView Javascript timers, as activity for result might be using them
254253
boolean keepRunning = this.keepRunning || this.cordovaInterface.activityResultCallback != null;
255254
this.appView.handlePause(keepRunning);
256255
}

framework/src/org/apache/cordova/CordovaClientCertRequest.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public void cancel()
4747
request.cancel();
4848
}
4949

50-
/*
51-
* Returns the host name of the server requesting the certificate.
50+
/**
51+
* @return the host name of the server requesting the certificate.
5252
*/
5353
@SuppressLint("NewApi")
5454
@Override
@@ -57,8 +57,8 @@ public String getHost()
5757
return request.getHost();
5858
}
5959

60-
/*
61-
* Returns the acceptable types of asymmetric keys (can be null).
60+
/**
61+
* @return the acceptable types of asymmetric keys (can be null).
6262
*/
6363
@SuppressLint("NewApi")
6464
@Override
@@ -67,8 +67,8 @@ public String[] getKeyTypes()
6767
return request.getKeyTypes();
6868
}
6969

70-
/*
71-
* Returns the port number of the server requesting the certificate.
70+
/**
71+
* @return the port number of the server requesting the certificate.
7272
*/
7373
@SuppressLint("NewApi")
7474
@Override
@@ -77,8 +77,8 @@ public int getPort()
7777
return request.getPort();
7878
}
7979

80-
/*
81-
* Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
80+
/**
81+
* @return the acceptable certificate issuers for the certificate matching the private key (can be null).
8282
*/
8383
@SuppressLint("NewApi")
8484
@Override
@@ -87,7 +87,7 @@ public Principal[] getPrincipals()
8787
return request.getPrincipals();
8888
}
8989

90-
/*
90+
/**
9191
* Ignore the request for now. Do not remember user's choice.
9292
*/
9393
@SuppressLint("NewApi")
@@ -97,7 +97,7 @@ public void ignore()
9797
request.ignore();
9898
}
9999

100-
/*
100+
/**
101101
* Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests.
102102
*
103103
* @param privateKey The privateKey

framework/src/org/apache/cordova/CordovaDialogsHelper.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
118118
* If the client returns true, WebView will assume that the client will
119119
* handle the prompt dialog and call the appropriate JsPromptResult method.
120120
*
121-
* Since we are hacking prompts for our own purposes, we should not be using them for
122-
* this purpose, perhaps we should hack console.log to do this instead!
121+
* <p>Since we are hacking prompts for our own purposes, we should not be using them for
122+
* this purpose, perhaps we should hack console.log to do this instead!</p>
123123
*/
124124
public void showPrompt(String message, String defaultValue, final Result result) {
125125
// Returning false would also show a dialog, but the default one shows the origin (ugly).

framework/src/org/apache/cordova/CordovaInterface.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public interface CordovaInterface {
5151
/**
5252
* Get the Android activity.
5353
*
54-
* If a custom engine lives outside of the Activity's lifecycle the return value may be null.
54+
* <p>If a custom engine lives outside of the Activity's lifecycle the return value
55+
* may be null.</p>
5556
*
5657
* @return the Activity
5758
*/
@@ -74,7 +75,7 @@ public interface CordovaInterface {
7475
public Object onMessage(String id, Object data);
7576

7677
/**
77-
* Returns a shared thread pool that can be used for background tasks.
78+
* @return a shared thread pool that can be used for background tasks.
7879
*/
7980
public ExecutorService getThreadPool();
8081

@@ -89,7 +90,9 @@ public interface CordovaInterface {
8990
public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions);
9091

9192
/**
92-
* Check for a permission. Returns true if the permission is granted, false otherwise.
93+
* Check for a permission.
94+
*
95+
* @return true if the permission is granted, false otherwise.
9396
*/
9497
public boolean hasPermission(String permission);
9598

framework/src/org/apache/cordova/CordovaInterfaceImpl.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ public void onCordovaInit(PluginManager pluginManager) {
135135
}
136136

137137
/**
138-
* Routes the result to the awaiting plugin. Returns false if no plugin was waiting.
138+
* Routes the result to the awaiting plugin.
139+
*
140+
* @return false if no plugin was waiting.
139141
*/
140142
public boolean onActivityResult(int requestCode, int resultCode, Intent intent) {
141143
CordovaPlugin callback = activityResultCallback;

0 commit comments

Comments
 (0)