Remove trailing whitespace in source code

This commit is contained in:
Sam Brannen
2015-03-07 21:16:18 +01:00
parent df1d90f48c
commit d90cee78ef
23 changed files with 521 additions and 521 deletions

View File

@@ -56,7 +56,7 @@ public class CodeFlow implements Opcodes {
* will be called after the main evaluation function has finished being generated.
*/
private List<FieldAdder> fieldAdders = null;
/**
* As SpEL ast nodes are called to generate code for the main evaluation method
* they can register to add code to a static initializer in the class. Any
@@ -64,19 +64,19 @@ public class CodeFlow implements Opcodes {
* has finished being generated.
*/
private List<ClinitAdder> clinitAdders = null;
/**
* Name of the class being generated. Typically used when generating code
* that accesses freshly generated fields on the generated type.
*/
private String clazzName;
/**
* When code generation requires holding a value in a class level field, this
* is used to track the next available field id (used as a name suffix).
*/
private int nextFieldId = 1;
/**
* When code generation requires an intermediate variable within a method,
* this method records the next available variable (variable 0 is 'this').
@@ -222,7 +222,7 @@ public class CodeFlow implements Opcodes {
mv.visitTypeInsn(CHECKCAST, "java/lang/Number");
}
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Number", "doubleValue", "()D", false);
break;
break;
case 'F':
if (stackDescriptor.equals("Ljava/lang/Object")) {
mv.visitTypeInsn(CHECKCAST, "java/lang/Number");
@@ -246,7 +246,7 @@ public class CodeFlow implements Opcodes {
throw new IllegalArgumentException("Unboxing should not be attempted for descriptor '" + targetDescriptor + "'");
}
}
/**
* Insert any necessary numeric conversion bytecodes based upon what is on the stack and the desired target type.
* @param mv the method visitor into which instructions should be placed
@@ -327,7 +327,7 @@ public class CodeFlow implements Opcodes {
}
}
/**
* Create the JVM signature descriptor for a method. This consists of the descriptors
* for the method parameters surrounded with parentheses, followed by the
@@ -777,7 +777,7 @@ public class CodeFlow implements Opcodes {
}
return descriptors;
}
/**
* Called after the main expression evaluation method has been generated, this
* method will callback any registered FieldAdders or ClinitAdders to add any
@@ -815,7 +815,7 @@ public class CodeFlow implements Opcodes {
}
/**
* Register a ClinitAdder which will add code to the static
* Register a ClinitAdder which will add code to the static
* initializer in the generated class to support the code
* produced by an ast nodes primary generateCode() method.
*/
@@ -837,11 +837,11 @@ public class CodeFlow implements Opcodes {
public String getClassname() {
return clazzName;
}
public interface FieldAdder {
public void generateField(ClassWriter cw, CodeFlow codeflow);
}
public interface ClinitAdder {
public void generateCode(MethodVisitor mv, CodeFlow codeflow);
}
@@ -863,11 +863,11 @@ public class CodeFlow implements Opcodes {
}
else {
mv.visitLdcInsn(value);
}
}
}
/**
* Produce appropriate bytecode to store a stack item in an array. The
* Produce appropriate bytecode to store a stack item in an array. The
* instruction to use varies depending on whether the type
* is a primitive or reference type.
* @param mv where to insert the bytecode
@@ -901,7 +901,7 @@ public class CodeFlow implements Opcodes {
public static int arrayCodeFor(String arraytype) {
switch (arraytype.charAt(0)) {
case 'I': return T_INT;
case 'J': return T_LONG;
case 'J': return T_LONG;
case 'F': return T_FLOAT;
case 'D': return T_DOUBLE;
case 'B': return T_BYTE;
@@ -925,9 +925,9 @@ public class CodeFlow implements Opcodes {
}
return false;
}
/**
* Produce the correct bytecode to build an array. The opcode to use and the
* Produce the correct bytecode to build an array. The opcode to use and the
* signature to pass along with the opcode can vary depending on the signature
* of the array type.
* @param mv the methodvisitor into which code should be inserted
@@ -972,5 +972,5 @@ public class CodeFlow implements Opcodes {
}
}
}

View File

@@ -21,7 +21,7 @@ import org.springframework.asm.Opcodes;
import org.springframework.expression.PropertyAccessor;
/**
* A compilable property accessor is able to generate bytecode that represents
* A compilable property accessor is able to generate bytecode that represents
* the access operation, facilitating compilation to bytecode of expressions
* that use the accessor.
*

View File

@@ -23,12 +23,12 @@ import org.springframework.expression.EvaluationException;
* Base superclass for compiled expressions. Each generated compiled expression class
* will extend this class and implement the {@link #getValue} method. It is not intended
* to be subclassed by user code.
*
*
* @author Andy Clement
* @since 4.1
*/
public abstract class CompiledExpression {
/**
* Subclasses of CompiledExpression generated by SpelCompiler will provide an
* implementation of this method.

View File

@@ -250,7 +250,7 @@ public enum SpelMessage {
MISSING_SELECTION_EXPRESSION(Kind.ERROR, 1071,
"A required selection expression has not been specified"),
EXCEPTION_RUNNING_COMPILED_EXPRESSION(Kind.ERROR,1072,
"An exception occurred whilst evaluating a compiled expression");

View File

@@ -622,7 +622,7 @@ class InternalSpelExpressionParser extends TemplateAwareExpressionParser {
// '}' - end of list
// ',' - more expressions in this list
// ':' - this is a map!
if (peekToken(TokenKind.RCURLY)) { // list with one item in it
List<SpelNodeImpl> listElements = new ArrayList<SpelNodeImpl>();
listElements.add(firstExpression);
@@ -638,7 +638,7 @@ class InternalSpelExpressionParser extends TemplateAwareExpressionParser {
while (peekToken(TokenKind.COMMA,true));
closingCurly = eatToken(TokenKind.RCURLY);
expr = new InlineList(toPos(t.startPos,closingCurly.endPos),listElements.toArray(new SpelNodeImpl[listElements.size()]));
}
else if (peekToken(TokenKind.COLON, true)) { // map!
List<SpelNodeImpl> mapElements = new ArrayList<SpelNodeImpl>();

View File

@@ -176,9 +176,9 @@ public class SpelCompiler implements Opcodes {
mv.visitMaxs(0, 0); // not supplied due to COMPUTE_MAXS
mv.visitEnd();
cw.visitEnd();
cf.finish();
byte[] data = cw.toByteArray();
// TODO need to make this conditionally occur based on a debug flag
// dump(expressionToCompile.toStringAST(), clazzName, data);

View File

@@ -66,7 +66,7 @@ public class SpelExpression implements Expression {
// Count of many times as the expression been interpreted - can trigger compilation
// when certain limit reached
private volatile int interpretedCount = 0;
// The number of times compilation was attempted and failed - enables us to eventually
// give up trying to compile it when it just doesn't seem to be possible.
private volatile int failedAttempts = 0;
@@ -448,8 +448,8 @@ public class SpelExpression implements Expression {
/**
* Perform expression compilation. This will only succeed once exit descriptors for all nodes have
* been determined. If the compilation fails and has failed more than 100 times the expression is
* Perform expression compilation. This will only succeed once exit descriptors for all nodes have
* been determined. If the compilation fails and has failed more than 100 times the expression is
* no longer considered suitable for compilation.
*/
public boolean compileExpression() {

View File

@@ -239,7 +239,7 @@ public class ReflectionHelper {
Integer varargsPosition = method.isVarArgs() ? method.getParameterTypes().length-1:null;
return convertArguments(converter, arguments, method, varargsPosition);
}
/**
* Takes an input set of argument values and converts them to the types specified as the
* required parameter types. The arguments are converted 'in-place' in the input array.

View File

@@ -35,11 +35,11 @@ import org.springframework.util.ReflectionUtils;
public class ReflectiveMethodExecutor implements MethodExecutor {
private final Method method;
private final Integer varargsPosition;
private boolean computedPublicDeclaringClass = false;
private Class<?> publicDeclaringClass;
private boolean argumentConversionOccurred = false;
@@ -58,10 +58,10 @@ public class ReflectiveMethodExecutor implements MethodExecutor {
public Method getMethod() {
return this.method;
}
/**
* Find the first public class in the methods declaring class hierarchy that declares this method.
* Sometimes the reflective method discovery logic finds a suitable method that can easily be
* Sometimes the reflective method discovery logic finds a suitable method that can easily be
* called via reflection but cannot be called from generated code when compiling the expression
* because of visibility restrictions. For example if a non public class overrides toString(), this
* helper method will walk up the type hierarchy to find the first public type that declares the
@@ -81,7 +81,7 @@ public class ReflectiveMethodExecutor implements MethodExecutor {
clazz.getDeclaredMethod(method.getName(), method.getParameterTypes());
return clazz;
} catch (NoSuchMethodException nsme) {
}
}
Class<?>[] intfaces = clazz.getInterfaces();
@@ -93,7 +93,7 @@ public class ReflectiveMethodExecutor implements MethodExecutor {
}
return null;
}
public boolean didArgumentConversionOccur() {
return this.argumentConversionOccurred;
}

View File

@@ -120,7 +120,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
}
return false;
}
public Member getLastReadInvokerPair() {
return lastReadInvokerPair.member;
}
@@ -656,7 +656,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
public void write(EvaluationContext context, Object target, String name, Object newValue) {
throw new UnsupportedOperationException("Should not be called on an OptimalPropertyAccessor");
}
@Override
public boolean isCompilable() {
return (Modifier.isPublic(this.member.getModifiers()) &&