Browse Source

Polishing.

Align literal vs code usage in Javadoc.

See #3344
Original pull request: #3351
issue/3353
Mark Paluch 4 months ago
parent
commit
aa282f5306
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 28
      src/main/java/org/springframework/data/repository/aot/generate/AotQueryMethodGenerationContext.java
  2. 2
      src/main/java/org/springframework/data/repository/aot/generate/AotRepositoryConstructorBuilder.java
  3. 22
      src/main/java/org/springframework/data/repository/aot/generate/JSONArray.java
  4. 26
      src/main/java/org/springframework/data/repository/aot/generate/JSONObject.java
  5. 2
      src/main/java/org/springframework/data/repository/aot/generate/JSONTokener.java

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

@ -179,7 +179,7 @@ public class AotQueryMethodGenerationContext { @@ -179,7 +179,7 @@ public class AotQueryMethodGenerationContext {
/**
* Returns the parameter name for the {@link Parameter#isBindable() bindable parameter} at the given
* {@code parameterIndex} or {@code null} if the parameter cannot be determined by its index.
* {@code parameterIndex} or {@literal null} if the parameter cannot be determined by its index.
*
* @param parameterIndex the zero-based parameter index as used in the query to reference bindable parameters.
* @return the method parameter name.
@ -225,7 +225,7 @@ public class AotQueryMethodGenerationContext { @@ -225,7 +225,7 @@ public class AotQueryMethodGenerationContext {
/**
* Returns the required parameter name for the {@link Parameter#isBindable() bindable parameter} at the given logical
* {@code parameterName} or {@code null} if the parameter cannot be determined by its name.
* {@code parameterName} or {@literal null} if the parameter cannot be determined by its name.
*
* @param parameterName the parameter name as used in the query to reference bindable parameters.
* @return the method parameter name.
@ -293,8 +293,8 @@ public class AotQueryMethodGenerationContext { @@ -293,8 +293,8 @@ public class AotQueryMethodGenerationContext {
}
/**
* @return the parameter name for the {@link org.springframework.data.domain.Sort sort parameter} or {@code null} if
* the method does not declare a sort parameter.
* @return the parameter name for the {@link org.springframework.data.domain.Sort sort parameter} or {@literal null}
* if the method does not declare a sort parameter.
*/
public @Nullable String getSortParameterName() {
return getParameterName(queryMethod.getParameters().getSortIndex());
@ -302,15 +302,15 @@ public class AotQueryMethodGenerationContext { @@ -302,15 +302,15 @@ public class AotQueryMethodGenerationContext {
/**
* @return the parameter name for the {@link org.springframework.data.domain.Pageable pageable parameter} or
* {@code null} if the method does not declare a pageable parameter.
* {@literal null} if the method does not declare a pageable parameter.
*/
public @Nullable String getPageableParameterName() {
return getParameterName(queryMethod.getParameters().getPageableIndex());
}
/**
* @return the parameter name for the {@link org.springframework.data.domain.Limit limit parameter} or {@code null} if
* the method does not declare a limit parameter.
* @return the parameter name for the {@link org.springframework.data.domain.Limit limit parameter} or {@literal null}
* if the method does not declare a limit parameter.
*/
public @Nullable String getLimitParameterName() {
return getParameterName(queryMethod.getParameters().getLimitIndex());
@ -318,14 +318,14 @@ public class AotQueryMethodGenerationContext { @@ -318,14 +318,14 @@ public class AotQueryMethodGenerationContext {
/**
* @return the parameter name for the {@link org.springframework.data.domain.ScrollPosition scroll position parameter}
* or {@code null} if the method does not declare a scroll position parameter.
* or {@literal null} if the method does not declare a scroll position parameter.
*/
public @Nullable String getScrollPositionParameterName() {
return getParameterName(queryMethod.getParameters().getScrollPositionIndex());
}
/**
* @return the parameter name for the {@link Class dynamic projection parameter} or {@code null} if the method does
* @return the parameter name for the {@link Class dynamic projection parameter} or {@literal null} if the method does
* not declare a dynamic projection parameter.
*/
public @Nullable String getDynamicProjectionParameterName() {
@ -333,16 +333,16 @@ public class AotQueryMethodGenerationContext { @@ -333,16 +333,16 @@ public class AotQueryMethodGenerationContext {
}
/**
* @return the parameter name for the {@link org.springframework.data.domain.Vector vector parameter} or {@code null}
* if the method does not declare a vector type parameter.
* @return the parameter name for the {@link org.springframework.data.domain.Vector vector parameter} or
* {@literal null} if the method does not declare a vector type parameter.
*/
public @Nullable String getVectorParameterName() {
return getParameterName(queryMethod.getParameters().getVectorIndex());
}
/**
* @return the parameter name for the {@link org.springframework.data.domain.Score score parameter} or {@code null} if
* the method does not declare a score type parameter.
* @return the parameter name for the {@link org.springframework.data.domain.Score score parameter} or {@literal null}
* if the method does not declare a score type parameter.
*/
public @Nullable String getScoreParameterName() {
return getParameterName(queryMethod.getParameters().getScoreIndex());
@ -350,7 +350,7 @@ public class AotQueryMethodGenerationContext { @@ -350,7 +350,7 @@ public class AotQueryMethodGenerationContext {
/**
* @return the parameter name for the {@link org.springframework.data.domain.Range score range parameter} or
* {@code null} if the method does not declare a score range type parameter.
* {@literal null} if the method does not declare a score range type parameter.
*/
public @Nullable String getScoreRangeParameterName() {
return getParameterName(queryMethod.getParameters().getScoreRangeIndex());

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

@ -249,7 +249,7 @@ public interface AotRepositoryConstructorBuilder { @@ -249,7 +249,7 @@ public interface AotRepositoryConstructorBuilder {
}
/**
* Obtain the reference name to obtain the parameter value from. Can be {@code null} if the parameter value is
* Obtain the reference name to obtain the parameter value from. Can be {@literal null} if the parameter value is
* solely obtained from the {@link #getCodeBlock() code block}.
*
* @return name of the reference or {@literal null} if absent.

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

@ -28,13 +28,13 @@ import org.jspecify.annotations.NullUnmarked; @@ -28,13 +28,13 @@ import org.jspecify.annotations.NullUnmarked;
/**
* A dense indexed sequence of values. Values may be any mix of {@link JSONObject JSONObjects}, other {@link JSONArray
* JSONArrays}, Strings, Booleans, Integers, Longs, Doubles, {@code null} or {@link JSONObject#NULL}. Values may not be
* {@link Double#isNaN() NaNs}, {@link Double#isInfinite() infinities}, or of any type not listed here.
* JSONArrays}, Strings, Booleans, Integers, Longs, Doubles, {@literal null} or {@link JSONObject#NULL}. Values may not
* be {@link Double#isNaN() NaNs}, {@link Double#isInfinite() infinities}, or of any type not listed here.
* <p>
* {@code JSONArray} has the same type coercion behavior and optional/mandatory accessors as {@link JSONObject}. See
* that class' documentation for details.
* <p>
* <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java {@code null}
* <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java {@literal null}
* reference, and the sentinel value {@link JSONObject#NULL}. In particular, {@code get} fails if the requested index
* holds the null reference, but succeeds if it holds {@code JSONObject.NULL}.
* <p>
@ -177,7 +177,7 @@ class JSONArray { @@ -177,7 +177,7 @@ class JSONArray {
* Appends {@code value} to the end of this array.
*
* @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer, Long, Double,
* {@link JSONObject#NULL}, or {@code null}. May not be {@link Double#isNaN() NaNs} or
* {@link JSONObject#NULL}, or {@literal null}. May not be {@link Double#isNaN() NaNs} or
* {@link Double#isInfinite() infinities}. Unsupported values are not permitted and will cause the array to
* be in an inconsistent state.
* @return this array.
@ -250,7 +250,7 @@ class JSONArray { @@ -250,7 +250,7 @@ class JSONArray {
*
* @param index the index to set the value to
* @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer, Long, Double,
* {@link JSONObject#NULL}, or {@code null}. May not be {@link Double#isNaN() NaNs} or
* {@link JSONObject#NULL}, or {@literal null}. May not be {@link Double#isNaN() NaNs} or
* {@link Double#isInfinite() infinities}.
* @return this array.
* @throws JSONException if processing of json failed
@ -269,7 +269,7 @@ class JSONArray { @@ -269,7 +269,7 @@ class JSONArray {
}
/**
* Returns true if this array has no value at {@code index}, or if its value is the {@code null} reference or
* Returns true if this array has no value at {@code index}, or if its value is the {@literal null} reference or
* {@link JSONObject#NULL}.
*
* @param index the index to set the value to
@ -285,8 +285,8 @@ class JSONArray { @@ -285,8 +285,8 @@ class JSONArray {
*
* @param index the index to get the value from
* @return the value at {@code index}.
* @throws JSONException if this array has no value at {@code index}, or if that value is the {@code null} reference.
* This method returns normally if the value is {@code JSONObject#NULL}.
* @throws JSONException if this array has no value at {@code index}, or if that value is the {@literal null}
* reference. This method returns normally if the value is {@code JSONObject#NULL}.
*/
public Object get(int index) throws JSONException {
try {
@ -304,7 +304,7 @@ class JSONArray { @@ -304,7 +304,7 @@ class JSONArray {
* Returns the value at {@code index}, or null if the array has no value at {@code index}.
*
* @param index the index to get the value from
* @return the value at {@code index} or {@code null}
* @return the value at {@code index} or {@literal null}
*/
public Object opt(int index) {
if (index < 0 || index >= this.values.size()) {
@ -552,7 +552,7 @@ class JSONArray { @@ -552,7 +552,7 @@ class JSONArray {
* JSONArray}. Returns null otherwise.
*
* @param index the index to get the value from
* @return the array at {@code index} or {@code null}
* @return the array at {@code index} or {@literal null}
*/
public JSONArray optJSONArray(int index) {
Object object = opt(index);
@ -582,7 +582,7 @@ class JSONArray { @@ -582,7 +582,7 @@ class JSONArray {
* JSONObject}. Returns null otherwise.
*
* @param index the index to get the value from
* @return the object at {@code index} or {@code null}
* @return the object at {@code index} or {@literal null}
*/
public JSONObject optJSONObject(int index) {
Object object = opt(index);

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

@ -29,8 +29,8 @@ import org.jspecify.annotations.NullUnmarked; @@ -29,8 +29,8 @@ import org.jspecify.annotations.NullUnmarked;
/**
* A modifiable set of name/value mappings. Names are unique, non-null strings. Values may be any mix of
* {@link JSONObject JSONObjects}, {@link JSONArray JSONArrays}, Strings, Booleans, Integers, Longs, Doubles or
* {@link #NULL}. Values may not be {@code null}, {@link Double#isNaN() NaNs}, {@link Double#isInfinite() infinities},
* or of any type not listed here.
* {@link #NULL}. Values may not be {@literal null}, {@link Double#isNaN() NaNs}, {@link Double#isInfinite()
* infinities}, or of any type not listed here.
* <p>
* This class can coerce values to another type when requested.
* <ul>
@ -56,7 +56,7 @@ import org.jspecify.annotations.NullUnmarked; @@ -56,7 +56,7 @@ import org.jspecify.annotations.NullUnmarked;
* if the requested name has no value or if the value cannot be coerced to the requested type.
* </ul>
* <p>
* <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java {@code null}
* <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java {@literal null}
* reference, and the sentinel value {@link JSONObject#NULL}. In particular, calling {@code put(name, null)} removes the
* named entry from the object but {@code put(name, JSONObject.NULL)} stores an entry whose value is
* {@code JSONObject.NULL}.
@ -71,7 +71,7 @@ class JSONObject { @@ -71,7 +71,7 @@ class JSONObject {
private static final Double NEGATIVE_ZERO = -0d;
/**
* A sentinel value used to explicitly define a name with no value. Unlike {@code null}, names with this value:
* A sentinel value used to explicitly define a name with no value. Unlike {@literal null}, names with this value:
* <ul>
* <li>show up in the {@link #names} array
* <li>show up in the {@link #keys} iterator
@ -80,8 +80,8 @@ class JSONObject { @@ -80,8 +80,8 @@ class JSONObject {
* <li>are included in the encoded JSON string.
* </ul>
* <p>
* This value violates the general contract of {@link Object#equals} by returning true when compared to {@code null}.
* Its {@link #toString} method returns "null".
* This value violates the general contract of {@link Object#equals} by returning true when compared to
* {@literal null}. Its {@link #toString} method returns "null".
*/
public static final Object NULL = new Object() {
@ -242,11 +242,11 @@ class JSONObject { @@ -242,11 +242,11 @@ class JSONObject {
/**
* Maps {@code name} to {@code value}, clobbering any existing name/value mapping with the same name. If the value is
* {@code null}, any existing mapping for {@code name} is removed.
* {@literal null}, any existing mapping for {@code name} is removed.
*
* @param name the name of the property
* @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer, Long, Double, {@link #NULL}, or
* {@code null}. May not be {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}.
* {@literal null}. May not be {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}.
* @return this object.
* @throws JSONException if an error occurs
*/
@ -370,7 +370,7 @@ class JSONObject { @@ -370,7 +370,7 @@ class JSONObject {
* Returns the value mapped by {@code name}, or null if no such mapping exists.
*
* @param name the name of the property
* @return the value or {@code null}
* @return the value or {@literal null}
*/
public Object opt(String name) {
return this.nameValuePairs.get(name);
@ -397,7 +397,7 @@ class JSONObject { @@ -397,7 +397,7 @@ class JSONObject {
* false otherwise.
*
* @param name the name of the property
* @return the value or {@code null}
* @return the value or {@literal null}
*/
public boolean optBoolean(String name) {
return optBoolean(name, false);
@ -607,7 +607,7 @@ class JSONObject { @@ -607,7 +607,7 @@ class JSONObject {
* JSONArray}. Returns null otherwise.
*
* @param name the name of the property
* @return the value or {@code null}
* @return the value or {@literal null}
*/
public JSONArray optJSONArray(String name) {
Object object = opt(name);
@ -637,7 +637,7 @@ class JSONObject { @@ -637,7 +637,7 @@ class JSONObject {
* JSONObject}. Returns null otherwise.
*
* @param name the name of the property
* @return the value or {@code null}
* @return the value or {@literal null}
*/
public JSONObject optJSONObject(String name) {
Object object = opt(name);
@ -794,7 +794,7 @@ class JSONObject { @@ -794,7 +794,7 @@ class JSONObject {
* Wraps the given object if necessary.
* <p>
* If the object is null or, returns {@link #NULL}. If the object is a {@code JSONArray} or {@code JSONObject}, no
* wrapping is necessary. If the object is {@code NULL}, no wrapping is necessary. If the object is an array or
* wrapping is necessary. If the object is {@literal null}, no wrapping is necessary. If the object is an array or
* {@code Collection}, returns an equivalent {@code JSONArray}. If the object is a {@code Map}, returns an equivalent
* {@code JSONObject}. If the object is a primitive wrapper type or {@code String}, returns the object. Otherwise if
* the object is from a {@code java} package, returns the result of {@code toString}. If wrapping fails, returns null.

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

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

Loading…
Cancel
Save