Skip to content

Commit 6b4597c

Browse files
author
yuyang
committed
Merge branch 'master' of https://github.com/spring-projects/spring-framework into read_yuyang
* 'master' of https://github.com/spring-projects/spring-framework: Include Objenesis NOTICE file contents in binary distributions Fix Checkstyle violation Update copyright date Simplify getParsedSql() method in NamedParameterJdbcTemplate Document supported characters for identifiers in SpEL expressions
2 parents 2001b50 + 3b983e2 commit 6b4597c

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java

+2-7
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-2020 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.
@@ -430,12 +430,7 @@ protected ParsedSql getParsedSql(String sql) {
430430
return NamedParameterUtils.parseSqlStatement(sql);
431431
}
432432
synchronized (this.parsedSqlCache) {
433-
ParsedSql parsedSql = this.parsedSqlCache.get(sql);
434-
if (parsedSql == null) {
435-
parsedSql = NamedParameterUtils.parseSqlStatement(sql);
436-
this.parsedSqlCache.put(sql, parsedSql);
437-
}
438-
return parsedSql;
433+
return this.parsedSqlCache.computeIfAbsent(sql, NamedParameterUtils::parseSqlStatement);
439434
}
440435
}
441436

src/docs/asciidoc/core/core-expressions.adoc

+14-2
Original file line numberDiff line numberDiff line change
@@ -1382,8 +1382,20 @@ example shows how to use the `new` operator to invoke constructors:
13821382
=== Variables
13831383

13841384
You can reference variables in the expression by using the `#variableName` syntax. Variables
1385-
are set by using the `setVariable` method on `EvaluationContext` implementations. The
1386-
following example shows how to use variables:
1385+
are set by using the `setVariable` method on `EvaluationContext` implementations.
1386+
1387+
[NOTE]
1388+
====
1389+
Valid variable names must be composed of one or more of the following supported
1390+
characters.
1391+
1392+
* letters: `A` to `Z` and `a` to `z`
1393+
* digits: `0` to `9`
1394+
* underscore: `_`
1395+
* dollar sign: `$`
1396+
====
1397+
1398+
The following example shows how to use variables.
13871399

13881400
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
13891401
.Java

src/docs/dist/license.txt

+7
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ Per the LICENSE file in the Objenesis ZIP distribution downloaded from
261261
http://objenesis.org/download.html, Objenesis 3.1 is licensed under the
262262
Apache License, version 2.0, the text of which is included above.
263263

264+
Per the NOTICE file in the Objenesis ZIP distribution downloaded from
265+
http://objenesis.org/download.html and corresponding to section 4d of the
266+
Apache License, Version 2.0, in this case for Objenesis:
267+
268+
Objenesis
269+
Copyright 2006-2019 Joe Walnes, Henri Tremblay, Leonardo Mesquita
270+
264271

265272
===============================================================================
266273

0 commit comments

Comments
 (0)