File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
category : minorAnalysis
3
3
---
4
- * Add new method ` CharacterLiteral .getStringifiedValue` which attempts to compute the
5
- ` String.valueOf ` compile time constant value of the expression.
4
+ * Add new method ` CompileTimeConstantExpr .getStringifiedValue` which attempts to compute the
5
+ ` String.valueOf ` string rendering of a constant expression.
Original file line number Diff line number Diff line change @@ -201,17 +201,9 @@ class CompileTimeConstantExpr extends Expr {
201
201
result = this .( StringLiteral ) .getValue ( )
202
202
or
203
203
(
204
- if this .( AddExpr ) .getAnOperand ( ) .getType ( ) instanceof TypeString // If either operand type is already a String:
205
- then
206
- // Then the stringified version of the expression can be safely used as a String will be created.
207
- result =
208
- this .( AddExpr ) .getLeftOperand ( ) .( CompileTimeConstantExpr ) .getStringifiedValue ( ) +
209
- this .( AddExpr ) .getRightOperand ( ) .( CompileTimeConstantExpr ) .getStringifiedValue ( )
210
- else
211
- // Adding two literals of primitive type will not result in a String.
212
- result =
213
- this .( AddExpr ) .getLeftOperand ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) +
214
- this .( AddExpr ) .getRightOperand ( ) .( CompileTimeConstantExpr ) .getStringValue ( )
204
+ this .getType ( ) instanceof TypeString and
205
+ this .( AddExpr ) .getLeftOperand ( ) .( CompileTimeConstantExpr ) .getStringifiedValue ( ) +
206
+ this .( AddExpr ) .getRightOperand ( ) .( CompileTimeConstantExpr ) .getStringifiedValue ( )
215
207
)
216
208
or
217
209
// Ternary conditional, with compile-time constant condition.
You can’t perform that action at this time.
0 commit comments