Skip to content

Commit 9125827

Browse files
marcwrobelsbrannen
authored andcommitted
Fix and improve Javadoc in spring-expression
Closes gh-28800
1 parent e76fbcb commit 9125827

15 files changed

+25
-24
lines changed

spring-expression/src/main/java/org/springframework/expression/ConstructorResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.springframework.lang.Nullable;
2323

2424
/**
25-
* A constructor resolver attempts locate a constructor and returns a ConstructorExecutor
25+
* A constructor resolver attempts to locate a constructor and returns a ConstructorExecutor
2626
* that can be used to invoke that constructor. The ConstructorExecutor will be cached but
2727
* if it 'goes stale' the resolvers will be called again.
2828
*

spring-expression/src/main/java/org/springframework/expression/ParserContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
public interface ParserContext {
2828

2929
/**
30-
* Whether or not the expression being parsed is a template. A template expression
30+
* Whether the expression being parsed is a template. A template expression
3131
* consists of literal text that can be mixed with evaluatable blocks. Some examples:
3232
* <pre class="code">
3333
* Some literal text

spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public void unboxBooleanIfNecessary(MethodVisitor mv) {
171171

172172
/**
173173
* Called after the main expression evaluation method has been generated, this
174-
* method will callback any registered FieldAdders or ClinitAdders to add any
174+
* method will call back any registered FieldAdders or ClinitAdders to add any
175175
* extra information to the class representing the compiled expression.
176176
*/
177177
public void finish() {
@@ -1008,7 +1008,7 @@ public static void insertNewArrayCode(MethodVisitor mv, int size, String arrayty
10081008
/**
10091009
* For use in mathematical operators, handles converting from a (possibly boxed)
10101010
* number on the stack to a primitive numeric type.
1011-
* <p>For example, from a Integer to a double, just need to call 'Number.doubleValue()'
1011+
* <p>For example, from an Integer to a double, just need to call 'Number.doubleValue()'
10121012
* but from an int to a double, need to use the bytecode 'i2d'.
10131013
* @param mv the method visitor when instructions should be appended
10141014
* @param stackDescriptor a descriptor of the operand on the stack

spring-expression/src/main/java/org/springframework/expression/spel/SpelNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public interface SpelNode {
6666
void setValue(ExpressionState expressionState, @Nullable Object newValue) throws EvaluationException;
6767

6868
/**
69-
* Return the string form the this AST node.
69+
* Return the string form of this AST node.
7070
* @return the string form
7171
*/
7272
String toStringAST();

spring-expression/src/main/java/org/springframework/expression/spel/ast/ConstructorReference.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private TypedValue createNewInstance(ExpressionState state) throws EvaluationExc
140140

141141
// To determine which situation it is, the AccessException will contain a cause.
142142
// If the cause is an InvocationTargetException, a user exception was thrown inside the constructor.
143-
// Otherwise the constructor could not be invoked.
143+
// Otherwise, the constructor could not be invoked.
144144
if (ex.getCause() instanceof InvocationTargetException) {
145145
// User exception was the root cause - exit now
146146
Throwable rootCause = ex.getCause().getCause();
@@ -271,7 +271,7 @@ private TypedValue createArray(ExpressionState state) throws EvaluationException
271271
newArray = Array.newInstance(componentType, arraySize);
272272
}
273273
else {
274-
// Multi-dimensional - hold onto your hat!
274+
// Multidimensional - hold onto your hat!
275275
int[] dims = new int[this.dimensions.length];
276276
long numElements = 1;
277277
for (int d = 0; d < this.dimensions.length; d++) {
@@ -288,7 +288,7 @@ private TypedValue createArray(ExpressionState state) throws EvaluationException
288288
else {
289289
// There is an initializer
290290
if (this.dimensions == null || this.dimensions.length > 1) {
291-
// There is an initializer but this is a multi-dimensional array (e.g. new int[][]{{1,2},{3,4}})
291+
// There is an initializer but this is a multidimensional array (e.g. new int[][]{{1,2},{3,4}})
292292
// - this is not currently supported
293293
throw new SpelEvaluationException(getStartPosition(),
294294
SpelMessage.MULTIDIM_ARRAY_INITIALIZER_NOT_SUPPORTED);

spring-expression/src/main/java/org/springframework/expression/spel/ast/Elvis.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
import org.springframework.util.ObjectUtils;
2727

2828
/**
29-
* Represents the elvis operator ?:. For an expression "a?:b" if a is not null, the value
30-
* of the expression is "a", if a is null then the value of the expression is "b".
29+
* Represents the elvis operator <code>?:</code>. For an expression <code>a?:b</code> if <code>a</code> is not null,
30+
* the value of the expression is <code>a</code>, if <code>a</code> is null then the value of the expression is
31+
* <code>b</code>.
3132
*
3233
* @author Andy Clement
3334
* @author Juergen Hoeller
@@ -117,7 +118,7 @@ private void computeExitTypeDescriptor() {
117118
this.exitTypeDescriptor = conditionDescriptor;
118119
}
119120
else {
120-
// Use the easiest to compute common super type
121+
// Use the easiest to compute common supertype
121122
this.exitTypeDescriptor = "Ljava/lang/Object";
122123
}
123124
}

spring-expression/src/main/java/org/springframework/expression/spel/ast/OperatorInstanceof.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import org.springframework.util.Assert;
3030

3131
/**
32-
* The operator 'instanceof' checks if an object is of the class specified in the right
33-
* hand operand, in the same way that {@code instanceof} does in Java.
32+
* The operator 'instanceof' checks if an object is of the class specified in the
33+
* right-hand operand, in the same way that {@code instanceof} does in Java.
3434
*
3535
* @author Andy Clement
3636
* @since 3.0

spring-expression/src/main/java/org/springframework/expression/spel/ast/PropertyOrFieldReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public String toStringAST() {
164164
/**
165165
* Attempt to read the named property from the current context object.
166166
* @return the value of the property
167-
* @throws EvaluationException if any problem accessing the property or it cannot be found
167+
* @throws EvaluationException if any problem accessing the property, or if it cannot be found
168168
*/
169169
private TypedValue readProperty(TypedValue contextObject, EvaluationContext evalContext, String name)
170170
throws EvaluationException {

spring-expression/src/main/java/org/springframework/expression/spel/ast/Ternary.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void computeExitTypeDescriptor() {
7474
this.exitTypeDescriptor = leftDescriptor;
7575
}
7676
else {
77-
// Use the easiest to compute common super type
77+
// Use the easiest to compute common supertype
7878
this.exitTypeDescriptor = "Ljava/lang/Object";
7979
}
8080
}

spring-expression/src/main/java/org/springframework/expression/spel/standard/InternalSpelExpressionParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
import org.springframework.util.StringUtils;
7979

8080
/**
81-
* Hand-written SpEL parser. Instances are reusable but are not thread-safe.
81+
* Handwritten SpEL parser. Instances are reusable but are not thread-safe.
8282
*
8383
* @author Andy Clement
8484
* @author Juergen Hoeller

0 commit comments

Comments
 (0)