Always use 'this.' when accessing fields
Ensure that `this.` is used consistently when accessing class fields. Issue: SPR-16968
This commit is contained in:
committed by
Juergen Hoeller
parent
eeebd51f57
commit
0b53c1096a
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -167,11 +167,11 @@ public class InlineList extends SpelNodeImpl {
|
||||
// The children might be further lists if they are not constants. In this
|
||||
// situation do not call back into generateCode() because it will register another clinit adder.
|
||||
// Instead, directly build the list here:
|
||||
if (children[c] instanceof InlineList) {
|
||||
((InlineList)children[c]).generateClinitCode(clazzname, constantFieldName, mv, codeflow, true);
|
||||
if (this.children[c] instanceof InlineList) {
|
||||
((InlineList)this.children[c]).generateClinitCode(clazzname, constantFieldName, mv, codeflow, true);
|
||||
}
|
||||
else {
|
||||
children[c].generateCode(mv, codeflow);
|
||||
this.children[c].generateCode(mv, codeflow);
|
||||
String lastDesc = codeflow.lastDescriptor();
|
||||
if (CodeFlow.isPrimitive(lastDesc)) {
|
||||
CodeFlow.insertBoxIfNecessary(mv, lastDesc.charAt(0));
|
||||
|
||||
@@ -249,7 +249,7 @@ public class MethodReference extends SpelNodeImpl {
|
||||
Method method = ((ReflectiveMethodExecutor) executorToCheck.get()).getMethod();
|
||||
String descriptor = CodeFlow.toDescriptor(method.getReturnType());
|
||||
if (this.nullSafe && CodeFlow.isPrimitive(descriptor)) {
|
||||
originalPrimitiveExitTypeDescriptor = descriptor;
|
||||
this.originalPrimitiveExitTypeDescriptor = descriptor;
|
||||
this.exitTypeDescriptor = CodeFlow.toBoxedDescriptor(descriptor);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -116,7 +116,7 @@ public class VariableReference extends SpelNodeImpl {
|
||||
}
|
||||
else {
|
||||
mv.visitVarInsn(ALOAD, 2);
|
||||
mv.visitLdcInsn(name);
|
||||
mv.visitLdcInsn(this.name);
|
||||
mv.visitMethodInsn(INVOKEINTERFACE, "org/springframework/expression/EvaluationContext", "lookupVariable", "(Ljava/lang/String;)Ljava/lang/Object;",true);
|
||||
}
|
||||
CodeFlow.insertCheckCast(mv, this.exitTypeDescriptor);
|
||||
|
||||
@@ -256,12 +256,12 @@ public final class SpelCompiler implements Opcodes {
|
||||
}
|
||||
|
||||
int getClassesDefinedCount() {
|
||||
return classesDefinedCount;
|
||||
return this.classesDefinedCount;
|
||||
}
|
||||
|
||||
public Class<?> defineClass(String name, byte[] bytes) {
|
||||
Class<?> clazz = super.defineClass(name, bytes, 0, bytes.length);
|
||||
classesDefinedCount++;
|
||||
this.classesDefinedCount++;
|
||||
return clazz;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -185,7 +185,7 @@ public class SpelExpression implements Expression {
|
||||
public Object getValue(Object rootObject) throws EvaluationException {
|
||||
if (this.compiledAst != null) {
|
||||
try {
|
||||
return this.compiledAst.getValue(rootObject, evaluationContext);
|
||||
return this.compiledAst.getValue(rootObject, this.evaluationContext);
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
// If running in mixed mode, revert to interpreted
|
||||
|
||||
Reference in New Issue
Block a user