Relaxed position assertion (for overflows in large inline maps)

Issue: SPR-17605

(cherry picked from commit b2756f5bd2)
This commit is contained in:
Juergen Hoeller
2018-12-25 13:22:00 +01:00
parent 21baa7287b
commit c02446c5a8
2 changed files with 7 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 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.
@@ -21,8 +21,8 @@ import org.springframework.expression.TypedValue;
import org.springframework.expression.spel.ExpressionState;
/**
* Represents assignment. An alternative to calling setValue() for an expression is to use
* an assign.
* Represents assignment. An alternative to calling {@code setValue}
* for an expression which indicates an assign statement.
*
* <p>Example: 'someNumberProperty=42'
*
@@ -31,8 +31,8 @@ import org.springframework.expression.spel.ExpressionState;
*/
public class Assign extends SpelNodeImpl {
public Assign(int pos,SpelNodeImpl... operands) {
super(pos,operands);
public Assign(int pos, SpelNodeImpl... operands) {
super(pos, operands);
}

View File

@@ -66,12 +66,10 @@ public abstract class SpelNodeImpl implements SpelNode, Opcodes {
public SpelNodeImpl(int pos, SpelNodeImpl... operands) {
this.pos = pos;
// pos combines start and end so can never be zero because tokens cannot be zero length
Assert.isTrue(pos != 0, "Pos must not be 0");
if (!ObjectUtils.isEmpty(operands)) {
this.children = operands;
for (SpelNodeImpl childNode : operands) {
childNode.parent = this;
for (SpelNodeImpl operand : operands) {
operand.parent = this;
}
}
}