Skip to content

Commit c02446c

Browse files
committed
Relaxed position assertion (for overflows in large inline maps)
Issue: SPR-17605 (cherry picked from commit b2756f5)
1 parent 21baa72 commit c02446c

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

spring-expression/src/main/java/org/springframework/expression/spel/ast/Assign.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
2121
import org.springframework.expression.spel.ExpressionState;
2222

2323
/**
24-
* Represents assignment. An alternative to calling setValue() for an expression is to use
25-
* an assign.
24+
* Represents assignment. An alternative to calling {@code setValue}
25+
* for an expression which indicates an assign statement.
2626
*
2727
* <p>Example: 'someNumberProperty=42'
2828
*
@@ -31,8 +31,8 @@
3131
*/
3232
public class Assign extends SpelNodeImpl {
3333

34-
public Assign(int pos,SpelNodeImpl... operands) {
35-
super(pos,operands);
34+
public Assign(int pos, SpelNodeImpl... operands) {
35+
super(pos, operands);
3636
}
3737

3838

spring-expression/src/main/java/org/springframework/expression/spel/ast/SpelNodeImpl.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ public abstract class SpelNodeImpl implements SpelNode, Opcodes {
6666

6767
public SpelNodeImpl(int pos, SpelNodeImpl... operands) {
6868
this.pos = pos;
69-
// pos combines start and end so can never be zero because tokens cannot be zero length
70-
Assert.isTrue(pos != 0, "Pos must not be 0");
7169
if (!ObjectUtils.isEmpty(operands)) {
7270
this.children = operands;
73-
for (SpelNodeImpl childNode : operands) {
74-
childNode.parent = this;
71+
for (SpelNodeImpl operand : operands) {
72+
operand.parent = this;
7573
}
7674
}
7775
}

0 commit comments

Comments
 (0)