Merge branch '5.3.x'

# Conflicts:
#	spring-jms/src/main/java/org/springframework/jms/listener/endpoint/StandardJmsActivationSpecFactory.java
This commit is contained in:
Sam Brannen
2022-07-13 14:06:53 +02:00
55 changed files with 98 additions and 95 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();
@@ -270,7 +270,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++) {
@@ -287,7 +287,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

View File

@@ -35,7 +35,7 @@ public class OperatorOverloaderTests extends AbstractExpressionTests {
@Test
public void testSimpleOperations() throws Exception {
// no built in support for this:
// no built-in support for this:
evaluateAndCheckError("'abc'-true",SpelMessage.OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES);
StandardEvaluationContext eContext = TestScenarioCreator.getTestEvaluationContext();

View File

@@ -123,7 +123,7 @@ public class ScenariosForSpringSecurityExpressionTests extends AbstractExpressio
SpelExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext ctx = new StandardEvaluationContext();
ctx.setRootObject(new Supervisor("Ben")); // so non-qualified references 'hasRole()' 'hasIpAddress()' are invoked against it);
ctx.setRootObject(new Supervisor("Ben")); // so non-qualified references 'hasRole()' 'hasIpAddress()' are invoked against it;
ctx.addMethodResolver(new MyMethodResolver()); // NEEDS TO OVERRIDE THE REFLECTION ONE - SHOW REORDERING MECHANISM
// Might be better with a as a variable although it would work as a property too...

View File

@@ -84,7 +84,7 @@ public class SetValueTests extends AbstractExpressionTests {
StandardEvaluationContext lContext = TestScenarioCreator.getTestEvaluationContext();
// PROPERTYORFIELDREFERENCE
// Non existent field (or property):
// Non-existent field (or property):
Expression e1 = parser.parseExpression("arrayContainer.wibble");
assertThat(e1.isWritable(lContext)).as("Should not be writable!").isFalse();
@@ -103,12 +103,12 @@ public class SetValueTests extends AbstractExpressionTests {
assertThat(e4.isWritable(lContext)).as("Should not be writable!").isFalse();
// INDEXER
// non existent indexer (wibble made up)
// non-existent indexer (wibble made up)
Expression e5 = parser.parseExpression("arrayContainer.wibble[99]");
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
e5.isWritable(lContext));
// non existent indexer (index via a string)
// non-existent indexer (index via a string)
Expression e6 = parser.parseExpression("arrayContainer.ints['abc']");
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
e6.isWritable(lContext));

View File

@@ -272,7 +272,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertCanCompile(expression);
assertThat(expression.getValue()).asInstanceOf(BOOLEAN).isTrue();
// Only when the right hand operand is a direct type reference
// Only when the right-hand operand is a direct type reference
// will it be compilable.
StandardEvaluationContext ctx = new StandardEvaluationContext();
ctx.setVariable("foo", String.class);
@@ -4155,7 +4155,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
void propertyReference() {
TestClass6 tc = new TestClass6();
// non static field
// non-static field
expression = parser.parseExpression("orange");
assertCantCompile(expression);
assertThat(expression.getValue(tc)).isEqualTo("value1");

View File

@@ -602,7 +602,7 @@ class SpelReproTests extends AbstractExpressionTests {
/**
* Test whether {@link ReflectiveMethodResolver} follows Java Method Invocation
* Conversion order. And more precisely that widening reference conversion is 'higher'
* than a unboxing conversion.
* than an unboxing conversion.
*/
@Test
void conversionPriority_SPR8224() throws Exception {