Skip to content

Commit aa282f5

Browse files
committed
Polishing.
Align literal vs code usage in Javadoc. See #3344 Original pull request: #3351
1 parent 2aeaa70 commit aa282f5

File tree

5 files changed

+40
-40
lines changed

5 files changed

+40
-40
lines changed

src/main/java/org/springframework/data/repository/aot/generate/AotQueryMethodGenerationContext.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public String getRequiredBindableParameterName(int parameterIndex) {
179179

180180
/**
181181
* Returns the parameter name for the {@link Parameter#isBindable() bindable parameter} at the given
182-
* {@code parameterIndex} or {@code null} if the parameter cannot be determined by its index.
182+
* {@code parameterIndex} or {@literal null} if the parameter cannot be determined by its index.
183183
*
184184
* @param parameterIndex the zero-based parameter index as used in the query to reference bindable parameters.
185185
* @return the method parameter name.
@@ -225,7 +225,7 @@ public String getRequiredBindableParameterName(String parameterName) {
225225

226226
/**
227227
* Returns the required parameter name for the {@link Parameter#isBindable() bindable parameter} at the given logical
228-
* {@code parameterName} or {@code null} if the parameter cannot be determined by its name.
228+
* {@code parameterName} or {@literal null} if the parameter cannot be determined by its name.
229229
*
230230
* @param parameterName the parameter name as used in the query to reference bindable parameters.
231231
* @return the method parameter name.
@@ -293,64 +293,64 @@ public String localVariable(String variableName) {
293293
}
294294

295295
/**
296-
* @return the parameter name for the {@link org.springframework.data.domain.Sort sort parameter} or {@code null} if
297-
* the method does not declare a sort parameter.
296+
* @return the parameter name for the {@link org.springframework.data.domain.Sort sort parameter} or {@literal null}
297+
* if the method does not declare a sort parameter.
298298
*/
299299
public @Nullable String getSortParameterName() {
300300
return getParameterName(queryMethod.getParameters().getSortIndex());
301301
}
302302

303303
/**
304304
* @return the parameter name for the {@link org.springframework.data.domain.Pageable pageable parameter} or
305-
* {@code null} if the method does not declare a pageable parameter.
305+
* {@literal null} if the method does not declare a pageable parameter.
306306
*/
307307
public @Nullable String getPageableParameterName() {
308308
return getParameterName(queryMethod.getParameters().getPageableIndex());
309309
}
310310

311311
/**
312-
* @return the parameter name for the {@link org.springframework.data.domain.Limit limit parameter} or {@code null} if
313-
* the method does not declare a limit parameter.
312+
* @return the parameter name for the {@link org.springframework.data.domain.Limit limit parameter} or {@literal null}
313+
* if the method does not declare a limit parameter.
314314
*/
315315
public @Nullable String getLimitParameterName() {
316316
return getParameterName(queryMethod.getParameters().getLimitIndex());
317317
}
318318

319319
/**
320320
* @return the parameter name for the {@link org.springframework.data.domain.ScrollPosition scroll position parameter}
321-
* or {@code null} if the method does not declare a scroll position parameter.
321+
* or {@literal null} if the method does not declare a scroll position parameter.
322322
*/
323323
public @Nullable String getScrollPositionParameterName() {
324324
return getParameterName(queryMethod.getParameters().getScrollPositionIndex());
325325
}
326326

327327
/**
328-
* @return the parameter name for the {@link Class dynamic projection parameter} or {@code null} if the method does
328+
* @return the parameter name for the {@link Class dynamic projection parameter} or {@literal null} if the method does
329329
* not declare a dynamic projection parameter.
330330
*/
331331
public @Nullable String getDynamicProjectionParameterName() {
332332
return getParameterName(queryMethod.getParameters().getDynamicProjectionIndex());
333333
}
334334

335335
/**
336-
* @return the parameter name for the {@link org.springframework.data.domain.Vector vector parameter} or {@code null}
337-
* if the method does not declare a vector type parameter.
336+
* @return the parameter name for the {@link org.springframework.data.domain.Vector vector parameter} or
337+
* {@literal null} if the method does not declare a vector type parameter.
338338
*/
339339
public @Nullable String getVectorParameterName() {
340340
return getParameterName(queryMethod.getParameters().getVectorIndex());
341341
}
342342

343343
/**
344-
* @return the parameter name for the {@link org.springframework.data.domain.Score score parameter} or {@code null} if
345-
* the method does not declare a score type parameter.
344+
* @return the parameter name for the {@link org.springframework.data.domain.Score score parameter} or {@literal null}
345+
* if the method does not declare a score type parameter.
346346
*/
347347
public @Nullable String getScoreParameterName() {
348348
return getParameterName(queryMethod.getParameters().getScoreIndex());
349349
}
350350

351351
/**
352352
* @return the parameter name for the {@link org.springframework.data.domain.Range score range parameter} or
353-
* {@code null} if the method does not declare a score range type parameter.
353+
* {@literal null} if the method does not declare a score range type parameter.
354354
*/
355355
public @Nullable String getScoreRangeParameterName() {
356356
return getParameterName(queryMethod.getParameters().getScoreRangeIndex());

src/main/java/org/springframework/data/repository/aot/generate/AotRepositoryConstructorBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ static ParameterOrigin ofReference(String reference) {
249249
}
250250

251251
/**
252-
* Obtain the reference name to obtain the parameter value from. Can be {@code null} if the parameter value is
252+
* Obtain the reference name to obtain the parameter value from. Can be {@literal null} if the parameter value is
253253
* solely obtained from the {@link #getCodeBlock() code block}.
254254
*
255255
* @return name of the reference or {@literal null} if absent.

src/main/java/org/springframework/data/repository/aot/generate/JSONArray.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828

2929
/**
3030
* A dense indexed sequence of values. Values may be any mix of {@link JSONObject JSONObjects}, other {@link JSONArray
31-
* JSONArrays}, Strings, Booleans, Integers, Longs, Doubles, {@code null} or {@link JSONObject#NULL}. Values may not be
32-
* {@link Double#isNaN() NaNs}, {@link Double#isInfinite() infinities}, or of any type not listed here.
31+
* JSONArrays}, Strings, Booleans, Integers, Longs, Doubles, {@literal null} or {@link JSONObject#NULL}. Values may not
32+
* be {@link Double#isNaN() NaNs}, {@link Double#isInfinite() infinities}, or of any type not listed here.
3333
* <p>
3434
* {@code JSONArray} has the same type coercion behavior and optional/mandatory accessors as {@link JSONObject}. See
3535
* that class' documentation for details.
3636
* <p>
37-
* <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java {@code null}
37+
* <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java {@literal null}
3838
* reference, and the sentinel value {@link JSONObject#NULL}. In particular, {@code get} fails if the requested index
3939
* holds the null reference, but succeeds if it holds {@code JSONObject.NULL}.
4040
* <p>
@@ -177,7 +177,7 @@ public JSONArray put(long value) {
177177
* Appends {@code value} to the end of this array.
178178
*
179179
* @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer, Long, Double,
180-
* {@link JSONObject#NULL}, or {@code null}. May not be {@link Double#isNaN() NaNs} or
180+
* {@link JSONObject#NULL}, or {@literal null}. May not be {@link Double#isNaN() NaNs} or
181181
* {@link Double#isInfinite() infinities}. Unsupported values are not permitted and will cause the array to
182182
* be in an inconsistent state.
183183
* @return this array.
@@ -250,7 +250,7 @@ public JSONArray put(int index, long value) throws JSONException {
250250
*
251251
* @param index the index to set the value to
252252
* @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer, Long, Double,
253-
* {@link JSONObject#NULL}, or {@code null}. May not be {@link Double#isNaN() NaNs} or
253+
* {@link JSONObject#NULL}, or {@literal null}. May not be {@link Double#isNaN() NaNs} or
254254
* {@link Double#isInfinite() infinities}.
255255
* @return this array.
256256
* @throws JSONException if processing of json failed
@@ -269,7 +269,7 @@ public JSONArray put(int index, Object value) throws JSONException {
269269
}
270270

271271
/**
272-
* Returns true if this array has no value at {@code index}, or if its value is the {@code null} reference or
272+
* Returns true if this array has no value at {@code index}, or if its value is the {@literal null} reference or
273273
* {@link JSONObject#NULL}.
274274
*
275275
* @param index the index to set the value to
@@ -285,8 +285,8 @@ public boolean isNull(int index) {
285285
*
286286
* @param index the index to get the value from
287287
* @return the value at {@code index}.
288-
* @throws JSONException if this array has no value at {@code index}, or if that value is the {@code null} reference.
289-
* This method returns normally if the value is {@code JSONObject#NULL}.
288+
* @throws JSONException if this array has no value at {@code index}, or if that value is the {@literal null}
289+
* reference. This method returns normally if the value is {@code JSONObject#NULL}.
290290
*/
291291
public Object get(int index) throws JSONException {
292292
try {
@@ -304,7 +304,7 @@ public Object get(int index) throws JSONException {
304304
* Returns the value at {@code index}, or null if the array has no value at {@code index}.
305305
*
306306
* @param index the index to get the value from
307-
* @return the value at {@code index} or {@code null}
307+
* @return the value at {@code index} or {@literal null}
308308
*/
309309
public Object opt(int index) {
310310
if (index < 0 || index >= this.values.size()) {
@@ -552,7 +552,7 @@ public JSONArray getJSONArray(int index) throws JSONException {
552552
* JSONArray}. Returns null otherwise.
553553
*
554554
* @param index the index to get the value from
555-
* @return the array at {@code index} or {@code null}
555+
* @return the array at {@code index} or {@literal null}
556556
*/
557557
public JSONArray optJSONArray(int index) {
558558
Object object = opt(index);
@@ -582,7 +582,7 @@ public JSONObject getJSONObject(int index) throws JSONException {
582582
* JSONObject}. Returns null otherwise.
583583
*
584584
* @param index the index to get the value from
585-
* @return the object at {@code index} or {@code null}
585+
* @return the object at {@code index} or {@literal null}
586586
*/
587587
public JSONObject optJSONObject(int index) {
588588
Object object = opt(index);

src/main/java/org/springframework/data/repository/aot/generate/JSONObject.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
/**
3030
* A modifiable set of name/value mappings. Names are unique, non-null strings. Values may be any mix of
3131
* {@link JSONObject JSONObjects}, {@link JSONArray JSONArrays}, Strings, Booleans, Integers, Longs, Doubles or
32-
* {@link #NULL}. Values may not be {@code null}, {@link Double#isNaN() NaNs}, {@link Double#isInfinite() infinities},
33-
* or of any type not listed here.
32+
* {@link #NULL}. Values may not be {@literal null}, {@link Double#isNaN() NaNs}, {@link Double#isInfinite()
33+
* infinities}, or of any type not listed here.
3434
* <p>
3535
* This class can coerce values to another type when requested.
3636
* <ul>
@@ -56,7 +56,7 @@
5656
* if the requested name has no value or if the value cannot be coerced to the requested type.
5757
* </ul>
5858
* <p>
59-
* <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java {@code null}
59+
* <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java {@literal null}
6060
* reference, and the sentinel value {@link JSONObject#NULL}. In particular, calling {@code put(name, null)} removes the
6161
* named entry from the object but {@code put(name, JSONObject.NULL)} stores an entry whose value is
6262
* {@code JSONObject.NULL}.
@@ -71,7 +71,7 @@ class JSONObject {
7171
private static final Double NEGATIVE_ZERO = -0d;
7272

7373
/**
74-
* A sentinel value used to explicitly define a name with no value. Unlike {@code null}, names with this value:
74+
* A sentinel value used to explicitly define a name with no value. Unlike {@literal null}, names with this value:
7575
* <ul>
7676
* <li>show up in the {@link #names} array
7777
* <li>show up in the {@link #keys} iterator
@@ -80,8 +80,8 @@ class JSONObject {
8080
* <li>are included in the encoded JSON string.
8181
* </ul>
8282
* <p>
83-
* This value violates the general contract of {@link Object#equals} by returning true when compared to {@code null}.
84-
* Its {@link #toString} method returns "null".
83+
* This value violates the general contract of {@link Object#equals} by returning true when compared to
84+
* {@literal null}. Its {@link #toString} method returns "null".
8585
*/
8686
public static final Object NULL = new Object() {
8787

@@ -242,11 +242,11 @@ public JSONObject put(String name, long value) throws JSONException {
242242

243243
/**
244244
* Maps {@code name} to {@code value}, clobbering any existing name/value mapping with the same name. If the value is
245-
* {@code null}, any existing mapping for {@code name} is removed.
245+
* {@literal null}, any existing mapping for {@code name} is removed.
246246
*
247247
* @param name the name of the property
248248
* @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer, Long, Double, {@link #NULL}, or
249-
* {@code null}. May not be {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}.
249+
* {@literal null}. May not be {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}.
250250
* @return this object.
251251
* @throws JSONException if an error occurs
252252
*/
@@ -370,7 +370,7 @@ public Object get(String name) throws JSONException {
370370
* Returns the value mapped by {@code name}, or null if no such mapping exists.
371371
*
372372
* @param name the name of the property
373-
* @return the value or {@code null}
373+
* @return the value or {@literal null}
374374
*/
375375
public Object opt(String name) {
376376
return this.nameValuePairs.get(name);
@@ -397,7 +397,7 @@ public boolean getBoolean(String name) throws JSONException {
397397
* false otherwise.
398398
*
399399
* @param name the name of the property
400-
* @return the value or {@code null}
400+
* @return the value or {@literal null}
401401
*/
402402
public boolean optBoolean(String name) {
403403
return optBoolean(name, false);
@@ -607,7 +607,7 @@ public JSONArray getJSONArray(String name) throws JSONException {
607607
* JSONArray}. Returns null otherwise.
608608
*
609609
* @param name the name of the property
610-
* @return the value or {@code null}
610+
* @return the value or {@literal null}
611611
*/
612612
public JSONArray optJSONArray(String name) {
613613
Object object = opt(name);
@@ -637,7 +637,7 @@ public JSONObject getJSONObject(String name) throws JSONException {
637637
* JSONObject}. Returns null otherwise.
638638
*
639639
* @param name the name of the property
640-
* @return the value or {@code null}
640+
* @return the value or {@literal null}
641641
*/
642642
public JSONObject optJSONObject(String name) {
643643
Object object = opt(name);
@@ -794,7 +794,7 @@ public static String quote(String data) {
794794
* Wraps the given object if necessary.
795795
* <p>
796796
* If the object is null or, returns {@link #NULL}. If the object is a {@code JSONArray} or {@code JSONObject}, no
797-
* wrapping is necessary. If the object is {@code NULL}, no wrapping is necessary. If the object is an array or
797+
* wrapping is necessary. If the object is {@literal null}, no wrapping is necessary. If the object is an array or
798798
* {@code Collection}, returns an equivalent {@code JSONArray}. If the object is a {@code Map}, returns an equivalent
799799
* {@code JSONObject}. If the object is a primitive wrapper type or {@code String}, returns the object. Otherwise if
800800
* the object is from a {@code java} package, returns the result of {@code toString}. If wrapping fails, returns null.

src/main/java/org/springframework/data/repository/aot/generate/JSONTokener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class JSONTokener {
6969

7070
/**
7171
* @param in JSON encoded string. Null is not permitted and will yield a tokener that throws
72-
* {@code NullPointerExceptions} when methods are called.
72+
* {@literal nullPointerExceptions} when methods are called.
7373
*/
7474
public JSONTokener(String in) {
7575
// consume an optional byte order mark (BOM) if it exists

0 commit comments

Comments
 (0)