Replace 'e.g.' with 'for example' in documentation and comments
Closes gh-33515
This commit is contained in:
committed by
Sam Brannen
parent
e55fe9077f
commit
8941e2876e
@@ -295,7 +295,7 @@ public class CodeFlow implements Opcodes {
|
||||
}
|
||||
// Check if we need to check-cast
|
||||
else if (!requiredTypeDesc.equals(lastDesc)) {
|
||||
// This would be unnecessary in the case of subtyping (e.g. method takes Number but Integer passed in)
|
||||
// This would be unnecessary in the case of subtyping (for example, method takes Number but Integer passed in)
|
||||
insertCheckCast(methodVisitor, requiredTypeDesc);
|
||||
}
|
||||
exitCompilationScope();
|
||||
@@ -474,7 +474,7 @@ public class CodeFlow implements Opcodes {
|
||||
* unlike the other descriptor forms the compiler is using which do not include the
|
||||
* trailing semicolon.
|
||||
* @param method the method
|
||||
* @return a String signature descriptor (e.g. "(ILjava/lang/String;)V")
|
||||
* @return a String signature descriptor (for example, "(ILjava/lang/String;)V")
|
||||
*/
|
||||
public static String createSignatureDescriptor(Method method) {
|
||||
Class<?>[] params = method.getParameterTypes();
|
||||
@@ -495,7 +495,7 @@ public class CodeFlow implements Opcodes {
|
||||
* descriptors here are JVM descriptors, unlike the other descriptor forms the
|
||||
* compiler is using which do not include the trailing semicolon.
|
||||
* @param ctor the constructor
|
||||
* @return a String signature descriptor (e.g. "(ILjava/lang/String;)V")
|
||||
* @return a String signature descriptor (for example, "(ILjava/lang/String;)V")
|
||||
*/
|
||||
public static String createSignatureDescriptor(Constructor<?> ctor) {
|
||||
Class<?>[] params = ctor.getParameterTypes();
|
||||
@@ -511,7 +511,7 @@ public class CodeFlow implements Opcodes {
|
||||
/**
|
||||
* Determine the JVM descriptor for a specified class. Unlike the other descriptors
|
||||
* used in the compilation process, this is the one the JVM wants, so this one
|
||||
* includes any necessary trailing semicolon (e.g. Ljava/lang/String; rather than
|
||||
* includes any necessary trailing semicolon (for example, Ljava/lang/String; rather than
|
||||
* Ljava/lang/String)
|
||||
* @param clazz a class
|
||||
* @return the JVM descriptor for the class
|
||||
@@ -597,7 +597,7 @@ public class CodeFlow implements Opcodes {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the descriptor is for a primitive array (e.g. "[[I").
|
||||
* Determine whether the descriptor is for a primitive array (for example, "[[I").
|
||||
* @param descriptor the descriptor for a possible primitive array
|
||||
* @return {@code true} if the descriptor a primitive array
|
||||
*/
|
||||
|
||||
@@ -320,7 +320,7 @@ public class ConstructorReference extends SpelNodeImpl {
|
||||
// There is an initializer
|
||||
if (this.dimensions == null || this.dimensions.length > 1) {
|
||||
// There is an initializer, but this is a multidimensional array
|
||||
// (e.g. new int[][]{{1,2},{3,4}}), which is not supported.
|
||||
// (for example, new int[][]{{1,2},{3,4}}), which is not supported.
|
||||
throw new SpelEvaluationException(getStartPosition(),
|
||||
SpelMessage.MULTIDIM_ARRAY_INITIALIZER_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Represent a list in an expression, e.g. '{1,2,3}'
|
||||
* Represent a list in an expression, for example, '{1,2,3}'.
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @author Sam Brannen
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Represent a map in an expression, e.g. '{name:'foo',age:12}'
|
||||
* Represent a map in an expression, for example, '{name:'foo',age:12}'.
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @author Sam Brannen
|
||||
|
||||
@@ -119,7 +119,7 @@ public class OpDec extends Operator {
|
||||
lvalue.setValue(newValue.getValue());
|
||||
}
|
||||
catch (SpelEvaluationException see) {
|
||||
// if unable to set the value the operand is not writable (e.g. 1-- )
|
||||
// if unable to set the value the operand is not writable (for example, 1-- )
|
||||
if (see.getMessageCode() == SpelMessage.SETVALUE_NOT_SUPPORTED) {
|
||||
throw new SpelEvaluationException(operand.getStartPosition(),
|
||||
SpelMessage.OPERAND_NOT_DECREMENTABLE);
|
||||
|
||||
@@ -115,7 +115,7 @@ public class OpInc extends Operator {
|
||||
valueRef.setValue(newValue.getValue());
|
||||
}
|
||||
catch (SpelEvaluationException see) {
|
||||
// If unable to set the value the operand is not writable (e.g. 1++ )
|
||||
// If unable to set the value the operand is not writable (for example, 1++ )
|
||||
if (see.getMessageCode() == SpelMessage.SETVALUE_NOT_SUPPORTED) {
|
||||
throw new SpelEvaluationException(operand.getStartPosition(), SpelMessage.OPERAND_NOT_INCREMENTABLE);
|
||||
}
|
||||
|
||||
@@ -340,12 +340,12 @@ public abstract class Operator extends SpelNodeImpl {
|
||||
|
||||
/**
|
||||
* Return an object that indicates whether the input descriptors are compatible.
|
||||
* <p>A declared descriptor is what could statically be determined (e.g. from looking
|
||||
* <p>A declared descriptor is what could statically be determined (for example, from looking
|
||||
* at the return value of a property accessor method) whilst an actual descriptor
|
||||
* is the type of an actual object that was returned, which may differ.
|
||||
* <p>For generic types with unbound type variables, the declared descriptor
|
||||
* discovered may be 'Object' but from the actual descriptor it is possible to
|
||||
* observe that the objects are really numeric values (e.g. ints).
|
||||
* observe that the objects are really numeric values (for example, ints).
|
||||
* @param leftDeclaredDescriptor the statically determinable left descriptor
|
||||
* @param rightDeclaredDescriptor the statically determinable right descriptor
|
||||
* @param leftActualDescriptor the dynamic/runtime left object descriptor
|
||||
|
||||
@@ -78,7 +78,7 @@ public class OperatorMatches extends Operator {
|
||||
* @return {@code true} if the first operand matches the regex specified as the
|
||||
* second operand, otherwise {@code false}
|
||||
* @throws EvaluationException if there is a problem evaluating the expression
|
||||
* (e.g. the regex is invalid)
|
||||
* (for example, the regex is invalid)
|
||||
*/
|
||||
@Override
|
||||
public BooleanTypedValue getValueInternal(ExpressionState state) throws EvaluationException {
|
||||
|
||||
@@ -970,7 +970,7 @@ class InternalSpelExpressionParser extends TemplateAwareExpressionParser {
|
||||
}
|
||||
|
||||
if (desiredTokenKind == TokenKind.IDENTIFIER) {
|
||||
// Might be one of the textual forms of the operators (e.g. NE for != ) -
|
||||
// Might be one of the textual forms of the operators (for example, NE for != ) -
|
||||
// in which case we can treat it as an identifier. The list is represented here:
|
||||
// Tokenizer.ALTERNATIVE_OPERATOR_NAMES and those ones are in order in the TokenKind enum.
|
||||
if (t.kind.ordinal() >= TokenKind.DIV.ordinal() && t.kind.ordinal() <= TokenKind.NOT.ordinal() &&
|
||||
|
||||
@@ -39,7 +39,7 @@ class Token {
|
||||
|
||||
/**
|
||||
* Constructor for use when there is no particular data for the token
|
||||
* (e.g. TRUE or '+').
|
||||
* (for example, TRUE or '+').
|
||||
* @param tokenKind the kind of token
|
||||
* @param startPos the exact start position
|
||||
* @param endPos the index of the last character
|
||||
|
||||
@@ -228,7 +228,7 @@ public class ReflectiveMethodResolver implements MethodResolver {
|
||||
private Set<Method> getMethods(Class<?> type, Object targetObject) {
|
||||
if (targetObject instanceof Class) {
|
||||
Set<Method> result = new LinkedHashSet<>();
|
||||
// Add these so that static methods are invocable on the type: e.g. Float.valueOf(..)
|
||||
// Add these so that static methods are invocable on the type: for example, Float.valueOf(..)
|
||||
for (Method method : getMethods(type)) {
|
||||
if (Modifier.isStatic(method.getModifiers())) {
|
||||
result.add(method);
|
||||
@@ -270,7 +270,7 @@ public class ReflectiveMethodResolver implements MethodResolver {
|
||||
/**
|
||||
* Return the set of methods for this type. The default implementation returns the
|
||||
* result of {@link Class#getMethods()} for the given {@code type}, but subclasses
|
||||
* may override in order to alter the results, e.g. specifying static methods
|
||||
* may override in order to alter the results, for example, specifying static methods
|
||||
* declared elsewhere.
|
||||
* @param type the class for which to return the methods
|
||||
* @since 3.1.1
|
||||
|
||||
@@ -382,7 +382,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
|
||||
method = findMethodForProperty(getPropertyMethodSuffixes(propertyName),
|
||||
"is", clazz, mustBeStatic, 0, BOOLEAN_TYPES);
|
||||
if (method == null) {
|
||||
// Record-style plain accessor method, e.g. name()
|
||||
// Record-style plain accessor method, for example, name()
|
||||
method = findMethodForProperty(new String[] {propertyName},
|
||||
"", clazz, mustBeStatic, 0, ANY_TYPES);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.springframework.lang.Nullable;
|
||||
* should be meaningfully restricted. Examples include but are not limited to
|
||||
* data binding expressions, property-based filters, and others. To that effect,
|
||||
* {@code SimpleEvaluationContext} is tailored to support only a subset of the
|
||||
* SpEL language syntax, e.g. excluding references to Java types, constructors,
|
||||
* SpEL language syntax, for example, excluding references to Java types, constructors,
|
||||
* and bean references.
|
||||
*
|
||||
* <p>When creating a {@code SimpleEvaluationContext} you need to choose the level of
|
||||
|
||||
Reference in New Issue
Block a user