The double-checked locking SpelExpression#compileExpression does not seem to be thread safe, because compiledAst is not volatile, see:
https://github.com/spring-projects/spring-framework/blob/master/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelExpression.java#L506
Or am I missing something?
Edit:
Also SpelExpression#compileExpression uses this.expression (a String) as a lock object. Shouldn't this be avoided, as Strings objects are shared throughout the program?
The double-checked locking
SpelExpression#compileExpressiondoes not seem to be thread safe, becausecompiledAstis notvolatile, see:https://github.com/spring-projects/spring-framework/blob/master/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelExpression.java#L506
Or am I missing something?
Edit:
Also
SpelExpression#compileExpressionusesthis.expression(aString) as a lock object. Shouldn't this be avoided, as Strings objects are shared throughout the program?