Skip to content

Commit 3b0859d

Browse files
committed
style: cleanup some of the comment blocks
1 parent ccdd881 commit 3b0859d

14 files changed

+50
-60
lines changed

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/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/CordovaInterface.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public interface CordovaInterface {
7474
public Object onMessage(String id, Object data);
7575

7676
/**
77-
* Returns a shared thread pool that can be used for background tasks.
77+
* @return a shared thread pool that can be used for background tasks.
7878
*/
7979
public ExecutorService getThreadPool();
8080

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

9191
/**
92-
* Check for a permission. Returns true if the permission is granted, false otherwise.
92+
* Check for a permission.
93+
*
94+
* @return true if the permission is granted, false otherwise.
9395
*/
9496
public boolean hasPermission(String permission);
9597

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;

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

+7-12
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected void pluginInitialize() {
7979
}
8080

8181
/**
82-
* Returns the plugin's service name (what you'd use when calling pluginManger.getPlugin())
82+
* @return the plugin's service name (what you'd use when calling pluginManger.getPlugin())
8383
*/
8484
public String getServiceName() {
8585
return serviceName;
@@ -289,7 +289,7 @@ public Boolean shouldOpenExternalUrl(String url) {
289289
* Allows plugins to handle a link being clicked. Return true here to cancel the navigation.
290290
*
291291
* @param url The URL that is trying to be loaded in the Cordova webview.
292-
* @return Return true to prevent the URL from loading. Default is false.
292+
* @return true to prevent the URL from loading. Default is false.
293293
*/
294294
public boolean onOverrideUrlLoading(String url) {
295295
return false;
@@ -362,7 +362,6 @@ public void onReset() {
362362
* @param handler The HttpAuthHandler used to set the WebView's response
363363
* @param host The host requiring authentication
364364
* @param realm The realm for which authentication is required
365-
*
366365
* @return Returns True if plugin will resolve this auth challenge, otherwise False
367366
*
368367
*/
@@ -376,8 +375,7 @@ public boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHa
376375
*
377376
* @param view The WebView that is initiating the callback
378377
* @param request The client certificate request
379-
*
380-
* @return Returns True if plugin will resolve this auth challenge, otherwise False
378+
* @return True if plugin will resolve this auth challenge, otherwise False
381379
*
382380
*/
383381
public boolean onReceivedClientCertRequest(CordovaWebView view, ICordovaClientCertRequest request) {
@@ -396,20 +394,17 @@ public void onConfigurationChanged(Configuration newConfig) {
396394
* Called by the Plugin Manager when we need to actually request permissions
397395
*
398396
* @param requestCode Passed to the activity to track the request
399-
*
400-
* @return Returns the permission that was stored in the plugin
397+
* @return The permission that was stored in the plugin
401398
*/
402-
403399
public void requestPermissions(int requestCode) {
404400
}
405401

406-
/*
402+
/**
407403
* Called by the WebView implementation to check for geolocation permissions, can be used
408404
* by other Java methods in the event that a plugin is using this as a dependency.
409405
*
410-
* @return Returns true if the plugin has all the permissions it needs to operate.
406+
* @return True if the plugin has all the permissions it needs to operate.
411407
*/
412-
413408
public boolean hasPermisssion() {
414409
return true;
415410
}
@@ -420,7 +415,6 @@ public boolean hasPermisssion() {
420415
* @param requestCode
421416
* @param permissions
422417
* @param grantResults
423-
*
424418
* @deprecated Use {@link #onRequestPermissionsResult} instead.
425419
*/
426420
@Deprecated
@@ -443,6 +437,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions,
443437

444438
/**
445439
* Allow plugins to supply a PathHandler for the WebViewAssetHandler
440+
*
446441
* @return a CordovaPluginPathHandler which listen for paths and returns a response
447442
*/
448443
public CordovaPluginPathHandler getPathHandler() {

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ public String remapPath(String path) {
143143
}
144144

145145
/**
146-
* Returns a File that points to the resource, or null if the resource
147-
* is not on the local filesystem.
146+
* @return A file that points to the resource, or null if the resource is not on the local filesystem.
148147
*/
149148
public File mapUriToFile(Uri uri) {
150149
assertBackgroundThread();
@@ -223,6 +222,7 @@ private String getMimeTypeFromPath(String path) {
223222

224223
/**
225224
* Opens a stream to the given URI, also providing the MIME type & length.
225+
*
226226
* @return Never returns null.
227227
* @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
228228
* resolved before being passed into this function.
@@ -235,6 +235,7 @@ public OpenForReadResult openForRead(Uri uri) throws IOException {
235235

236236
/**
237237
* Opens a stream to the given URI, also providing the MIME type & length.
238+
*
238239
* @return Never returns null.
239240
* @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
240241
* resolved before being passed into this function.
@@ -320,6 +321,7 @@ public OutputStream openOutputStream(Uri uri) throws IOException {
320321

321322
/**
322323
* Opens a stream to the given URI.
324+
*
323325
* @return Never returns null.
324326
* @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
325327
* resolved before being passed into this function.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public void pluginInitialize() {
7171
* @param action The action to execute.
7272
* @param args JSONArry of arguments for the plugin.
7373
* @param callbackContext The callback context from which we were invoked.
74+
*
7475
* @return A PluginResult object with a status and message.
7576
*/
7677
@Override
@@ -334,9 +335,8 @@ private void sendEventMessage(PluginResult payload) {
334335
}
335336
}
336337

337-
/*
338+
/**
338339
* Unregister the receiver
339-
*
340340
*/
341341
@Override
342342
public void onDestroy()

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@ public interface ICordovaClientCertRequest {
3131
*/
3232
public void cancel();
3333

34-
/*
35-
* Returns the host name of the server requesting the certificate.
34+
/**
35+
* @return the host name of the server requesting the certificate.
3636
*/
3737
public String getHost();
3838

39-
/*
40-
* Returns the acceptable types of asymmetric keys (can be null).
39+
/**
40+
* @return the acceptable types of asymmetric keys (can be null).
4141
*/
4242
public String[] getKeyTypes();
4343

44-
/*
45-
* Returns the port number of the server requesting the certificate.
44+
/**
45+
* @return the port number of the server requesting the certificate.
4646
*/
4747
public int getPort();
4848

49-
/*
50-
* Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
49+
/**
50+
* @return the acceptable certificate issuers for the certificate matching the private key (can be null).
5151
*/
5252
public Principal[] getPrincipals();
5353

54-
/*
54+
/**
5555
* Ignore the request for now. Do not remember user's choice.
5656
*/
5757
public void ignore();
5858

59-
/*
59+
/**
6060
* Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests.
6161
*
6262
* @param privateKey The privateKey

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,10 @@ private void packMessage(JsMessage message, StringBuilder sb) {
124124
}
125125

126126
/**
127-
* Combines and returns queued messages combined into a single string.
128-
*
129127
* Combines as many messages as possible, without exceeding
130128
* COMBINED_RESPONSE_CUTOFF in case of multiple response messages.
131129
*
132-
* Returns null if the queue is empty.
130+
* @return a string of queued messages combined or null if the queue is empty.
133131
*/
134132
public String popAndEncode(boolean fromOnlineEvent) {
135133
synchronized (this) {

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

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public static void requestPermissions(CordovaPlugin plugin, int requestCode, Str
6666
*
6767
* @param plugin The plugin the permission is being checked against
6868
* @param permission The permission to be checked
69-
*
7069
* @return True if the permission has already been granted and false otherwise
7170
*/
7271
public static boolean hasPermission(CordovaPlugin plugin, String permission) {

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

+5-9
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,7 @@ public void onPause(boolean multitasking) {
252252
* @param handler The HttpAuthHandler used to set the WebView's response
253253
* @param host The host requiring authentication
254254
* @param realm The realm for which authentication is required
255-
*
256-
* @return Returns True if there is a plugin which will resolve this auth challenge, otherwise False
257-
*
255+
* @return True if there is a plugin which will resolve this auth challenge, otherwise False
258256
*/
259257
public boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHandler handler, String host, String realm) {
260258
synchronized (this.pluginMap) {
@@ -273,9 +271,7 @@ public boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHa
273271
*
274272
* @param view The WebView that is initiating the callback
275273
* @param request The client certificate request
276-
*
277-
* @return Returns True if plugin will resolve this auth challenge, otherwise False
278-
*
274+
* @return True if plugin will resolve this auth challenge, otherwise False
279275
*/
280276
public boolean onReceivedClientCertRequest(CordovaWebView view, ICordovaClientCertRequest request) {
281277
synchronized (this.pluginMap) {
@@ -400,7 +396,7 @@ private String getLaunchUrlPrefix() {
400396
* the default policy is applied.
401397
*
402398
* @param url The URL that is being requested.
403-
* @return Returns true to allow the resource to load,
399+
* @return true to allow the resource to load,
404400
* false to block the resource.
405401
*/
406402
public boolean shouldAllowRequest(String url) {
@@ -440,7 +436,7 @@ public boolean shouldAllowRequest(String url) {
440436
* the default policy is applied.
441437
*
442438
* @param url The URL that is being requested.
443-
* @return Returns true to allow the navigation,
439+
* @return true to allow the navigation,
444440
* false to block the navigation.
445441
*/
446442
public boolean shouldAllowNavigation(String url) {
@@ -490,7 +486,7 @@ public boolean shouldAllowBridgeAccess(String url) {
490486
* the default policy is applied.
491487
*
492488
* @param url The URL that is being requested.
493-
* @return Returns true to allow the URL to launch an intent,
489+
* @return true to allow the URL to launch an intent,
494490
* false to block the intent.
495491
*/
496492
public Boolean shouldOpenExternalUrl(String url) {

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ public PluginResult getMultipartMessage(int index) {
118118
}
119119

120120
/**
121-
* If messageType == MESSAGE_TYPE_STRING, then returns the message string.
122-
* Otherwise, returns null.
121+
* @return message string when messageType is MESSAGE_TYPE_STRING otherwise null.
123122
*/
124123
public String getStrMessage() {
125124
return strMessage;

framework/src/org/apache/cordova/engine/SystemWebChromeClient.java

+1
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public void onHideCustomView() {
184184
/**
185185
* Ask the host application for a custom progress view to show while
186186
* a <video> is loading.
187+
*
187188
* @return View The progress view.
188189
*/
189190
public View getVideoLoadingProgressView() {

framework/src/org/apache/cordova/engine/SystemWebViewClient.java

-2
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ public void setAuthenticationToken(AuthenticationToken authenticationToken, Stri
332332
*
333333
* @param host
334334
* @param realm
335-
*
336335
* @return the authentication token or null if did not exist
337336
*/
338337
public AuthenticationToken removeAuthenticationToken(String host, String realm) {
@@ -350,7 +349,6 @@ public AuthenticationToken removeAuthenticationToken(String host, String realm)
350349
*
351350
* @param host
352351
* @param realm
353-
*
354352
* @return the authentication token
355353
*/
356354
public AuthenticationToken getAuthenticationToken(String host, String realm) {

0 commit comments

Comments
 (0)