Relaxed position assertion (for overflows in large inline maps)
Issue: SPR-17605
(cherry picked from commit b2756f5bd2)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user