Skip to content

Commit 7a77e83

Browse files
committed
SpelNodeImpl manages start/end position in separate integer values
Fixes spring-projectsgh-22157
1 parent 5aed117 commit 7a77e83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+280
-298
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -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 startPos, int endPos, SpelNodeImpl... operands) {
35+
super(startPos, endPos, operands);
3636
}
3737

3838

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -37,8 +37,8 @@ public class BeanReference extends SpelNodeImpl {
3737
private final String beanName;
3838

3939

40-
public BeanReference(int pos, String beanName) {
41-
super(pos);
40+
public BeanReference(int startPos, int endPos, String beanName) {
41+
super(startPos, endPos);
4242
this.beanName = beanName;
4343
}
4444

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -31,8 +31,8 @@ public class BooleanLiteral extends Literal {
3131
private final BooleanTypedValue value;
3232

3333

34-
public BooleanLiteral(String payload, int pos, boolean value) {
35-
super(payload, pos);
34+
public BooleanLiteral(String payload, int startPos, int endPos, boolean value) {
35+
super(payload, startPos, endPos);
3636
this.value = BooleanTypedValue.forValue(value);
3737
this.exitTypeDescriptor = "Z";
3838
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -33,8 +33,8 @@
3333
*/
3434
public class CompoundExpression extends SpelNodeImpl {
3535

36-
public CompoundExpression(int pos, SpelNodeImpl... expressionComponents) {
37-
super(pos, expressionComponents);
36+
public CompoundExpression(int startPos, int endPos, SpelNodeImpl... expressionComponents) {
37+
super(startPos, endPos, expressionComponents);
3838
if (expressionComponents.length < 2) {
3939
throw new IllegalStateException("Do not build compound expressions with less than two entries: " +
4040
expressionComponents.length);

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -72,17 +72,17 @@ public class ConstructorReference extends SpelNodeImpl {
7272
* Create a constructor reference. The first argument is the type, the rest are the parameters to the constructor
7373
* call
7474
*/
75-
public ConstructorReference(int pos, SpelNodeImpl... arguments) {
76-
super(pos, arguments);
75+
public ConstructorReference(int startPos, int endPos, SpelNodeImpl... arguments) {
76+
super(startPos, endPos, arguments);
7777
this.isArrayConstructor = false;
7878
}
7979

8080
/**
8181
* Create a constructor reference. The first argument is the type, the rest are the parameters to the constructor
8282
* call
8383
*/
84-
public ConstructorReference(int pos, SpelNodeImpl[] dimensions, SpelNodeImpl... arguments) {
85-
super(pos, arguments);
84+
public ConstructorReference(int startPos, int endPos, SpelNodeImpl[] dimensions, SpelNodeImpl... arguments) {
85+
super(startPos, endPos, arguments);
8686
this.isArrayConstructor = true;
8787
this.dimensions = dimensions;
8888
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -36,8 +36,8 @@
3636
*/
3737
public class Elvis extends SpelNodeImpl {
3838

39-
public Elvis(int pos, SpelNodeImpl... args) {
40-
super(pos, args);
39+
public Elvis(int startPos, int endPos, SpelNodeImpl... args) {
40+
super(startPos, endPos, args);
4141
}
4242

4343

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -32,8 +32,8 @@ public class FloatLiteral extends Literal {
3232
private final TypedValue value;
3333

3434

35-
public FloatLiteral(String payload, int pos, float value) {
36-
super(payload, pos);
35+
public FloatLiteral(String payload, int startPos, int endPos, float value) {
36+
super(payload, startPos, endPos);
3737
this.value = new TypedValue(value);
3838
this.exitTypeDescriptor = "F";
3939
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -57,8 +57,8 @@ public class FunctionReference extends SpelNodeImpl {
5757
private volatile Method method;
5858

5959

60-
public FunctionReference(String functionName, int pos, SpelNodeImpl... arguments) {
61-
super(pos, arguments);
60+
public FunctionReference(String functionName, int startPos, int endPos, SpelNodeImpl... arguments) {
61+
super(startPos, endPos, arguments);
6262
this.name = functionName;
6363
}
6464

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -31,8 +31,8 @@ public class Identifier extends SpelNodeImpl {
3131
private final TypedValue id;
3232

3333

34-
public Identifier(String payload, int pos) {
35-
super(pos);
34+
public Identifier(String payload, int startPos, int endPos) {
35+
super(startPos, endPos);
3636
this.id = new TypedValue(payload);
3737
}
3838

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -90,8 +90,8 @@ private enum IndexedType {ARRAY, LIST, MAP, STRING, OBJECT}
9090
private IndexedType indexedType;
9191

9292

93-
public Indexer(int pos, SpelNodeImpl expr) {
94-
super(pos, expr);
93+
public Indexer(int startPos, int endPos, SpelNodeImpl expr) {
94+
super(startPos, endPos, expr);
9595
}
9696

9797

0 commit comments

Comments
 (0)