Fix and improve Javadoc in spring-expression

Closes gh-28800
This commit is contained in:
Marc Wrobel
2022-07-12 15:57:04 +02:00
committed by Sam Brannen
parent e76fbcb290
commit 91258271e4
15 changed files with 25 additions and 24 deletions

View File

@@ -22,7 +22,7 @@ import org.springframework.core.convert.TypeDescriptor;
import org.springframework.lang.Nullable;
/**
* A constructor resolver attempts locate a constructor and returns a ConstructorExecutor
* A constructor resolver attempts to locate a constructor and returns a ConstructorExecutor
* that can be used to invoke that constructor. The ConstructorExecutor will be cached but
* if it 'goes stale' the resolvers will be called again.
*

View File

@@ -27,7 +27,7 @@ package org.springframework.expression;
public interface ParserContext {
/**
* Whether or not the expression being parsed is a template. A template expression
* Whether the expression being parsed is a template. A template expression
* consists of literal text that can be mixed with evaluatable blocks. Some examples:
* <pre class="code">
* Some literal text

View File

@@ -171,7 +171,7 @@ public class CodeFlow implements Opcodes {
/**
* Called after the main expression evaluation method has been generated, this
* method will callback any registered FieldAdders or ClinitAdders to add any
* method will call back any registered FieldAdders or ClinitAdders to add any
* extra information to the class representing the compiled expression.
*/
public void finish() {
@@ -1008,7 +1008,7 @@ public class CodeFlow implements Opcodes {
/**
* For use in mathematical operators, handles converting from a (possibly boxed)
* number on the stack to a primitive numeric type.
* <p>For example, from a Integer to a double, just need to call 'Number.doubleValue()'
* <p>For example, from an Integer to a double, just need to call 'Number.doubleValue()'
* but from an int to a double, need to use the bytecode 'i2d'.
* @param mv the method visitor when instructions should be appended
* @param stackDescriptor a descriptor of the operand on the stack

View File

@@ -66,7 +66,7 @@ public interface SpelNode {
void setValue(ExpressionState expressionState, @Nullable Object newValue) throws EvaluationException;
/**
* Return the string form the this AST node.
* Return the string form of this AST node.
* @return the string form
*/
String toStringAST();

View File

@@ -140,7 +140,7 @@ public class ConstructorReference extends SpelNodeImpl {
// To determine which situation it is, the AccessException will contain a cause.
// If the cause is an InvocationTargetException, a user exception was thrown inside the constructor.
// Otherwise the constructor could not be invoked.
// Otherwise, the constructor could not be invoked.
if (ex.getCause() instanceof InvocationTargetException) {
// User exception was the root cause - exit now
Throwable rootCause = ex.getCause().getCause();
@@ -271,7 +271,7 @@ public class ConstructorReference extends SpelNodeImpl {
newArray = Array.newInstance(componentType, arraySize);
}
else {
// Multi-dimensional - hold onto your hat!
// Multidimensional - hold onto your hat!
int[] dims = new int[this.dimensions.length];
long numElements = 1;
for (int d = 0; d < this.dimensions.length; d++) {
@@ -288,7 +288,7 @@ public class ConstructorReference extends SpelNodeImpl {
else {
// There is an initializer
if (this.dimensions == null || this.dimensions.length > 1) {
// There is an initializer but this is a multi-dimensional array (e.g. new int[][]{{1,2},{3,4}})
// There is an initializer but this is a multidimensional array (e.g. new int[][]{{1,2},{3,4}})
// - this is not currently supported
throw new SpelEvaluationException(getStartPosition(),
SpelMessage.MULTIDIM_ARRAY_INITIALIZER_NOT_SUPPORTED);

View File

@@ -26,8 +26,9 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
/**
* Represents the elvis operator ?:. For an expression "a?:b" if a is not null, the value
* of the expression is "a", if a is null then the value of the expression is "b".
* Represents the elvis operator <code>?:</code>. For an expression <code>a?:b</code> if <code>a</code> is not null,
* the value of the expression is <code>a</code>, if <code>a</code> is null then the value of the expression is
* <code>b</code>.
*
* @author Andy Clement
* @author Juergen Hoeller
@@ -117,7 +118,7 @@ public class Elvis extends SpelNodeImpl {
this.exitTypeDescriptor = conditionDescriptor;
}
else {
// Use the easiest to compute common super type
// Use the easiest to compute common supertype
this.exitTypeDescriptor = "Ljava/lang/Object";
}
}

View File

@@ -29,8 +29,8 @@ import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
* The operator 'instanceof' checks if an object is of the class specified in the right
* hand operand, in the same way that {@code instanceof} does in Java.
* The operator 'instanceof' checks if an object is of the class specified in the
* right-hand operand, in the same way that {@code instanceof} does in Java.
*
* @author Andy Clement
* @since 3.0

View File

@@ -164,7 +164,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
/**
* Attempt to read the named property from the current context object.
* @return the value of the property
* @throws EvaluationException if any problem accessing the property or it cannot be found
* @throws EvaluationException if any problem accessing the property, or if it cannot be found
*/
private TypedValue readProperty(TypedValue contextObject, EvaluationContext evalContext, String name)
throws EvaluationException {

View File

@@ -74,7 +74,7 @@ public class Ternary extends SpelNodeImpl {
this.exitTypeDescriptor = leftDescriptor;
}
else {
// Use the easiest to compute common super type
// Use the easiest to compute common supertype
this.exitTypeDescriptor = "Ljava/lang/Object";
}
}

View File

@@ -78,7 +78,7 @@ import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* Hand-written SpEL parser. Instances are reusable but are not thread-safe.
* Handwritten SpEL parser. Instances are reusable but are not thread-safe.
*
* @author Andy Clement
* @author Juergen Hoeller