Commit Graph

429 Commits

Author SHA1 Message Date
Syuziko eaf9deedfd Polish tests
See gh-27248
2021-08-07 18:53:47 +02:00
Stephane Nicoll 403e1f2505 Update copyright year of changed file
See gh-27102
2021-07-02 08:11:41 +02:00
diguage f39c6d36c7 Simplify Comparator using method references
See gh-27102
2021-07-02 08:10:22 +02:00
Sam Brannen a2ef6badc4 Use StringBuilder.append(char) where possible
To slightly improve performance, this commit switches to
StringBuilder.append(char) instead of StringBuilder.append(String)
whenever we append a single character to a StringBuilder.

Closes gh-27098
2021-06-25 10:44:28 +02:00
Sam Brannen 7c3a18490b Polish SpEL SelectionAndProjectionTests 2021-04-26 16:23:21 +02:00
Sam Brannen 6c3a0a9026 Polishing 2021-04-22 18:53:31 +02:00
Brandon Fergerson 432c720dd0
Allow spring-expression to be more easily repackaged
This commit allows the spring-expression module to be more easily repackaged
for embedding in third-party JARs -- for example, via the Shadow Gradle plugin.

Closes gh-26779
2021-04-09 17:29:29 +02:00
Rossen Stoyanchev 1e481cd14c Fix checkstyle violation 2021-02-03 12:12:52 +00:00
Sam Brannen 8589804012 Link to known property name constants in SpringProperties 2021-02-02 15:20:41 +01:00
Juergen Hoeller 01fb4dbeba Polishing
See gh-26237
2020-12-08 14:59:10 +01:00
fengyuanwei 07fadae27d Remove duplicate "property" in PropertyCacheKey.toString() 2020-12-08 14:49:33 +01:00
Sam Brannen 7b3f53de50 Polish SpelParserTests 2020-12-04 18:49:05 +01:00
limo520 ef05eb3729
Fix assertions in SpelParserTests.generalExpressions
Closes gh-26211

Co-authored-by: fengyuanwei <fengyuanwei@wondersgroup.com>
2020-12-04 13:59:16 +01:00
Сергей Цыпанов 83996b12cc Simplify AstUtils.getPropertyAccessorsToTry() 2020-11-16 16:11:31 +01:00
Juergen Hoeller 19911af30a Polishing 2020-11-05 19:09:58 +01:00
Juergen Hoeller 6acb091c4e Upgrade SpelCompiler bytecode level to 1.8 and optimize for concurrent access
Closes gh-26033
2020-11-05 17:44:40 +01:00
Juergen Hoeller 4e8d6bea4d Fix test code formatting 2020-11-04 16:52:11 +01:00
Juergen Hoeller 079ca80854 SpEL supports record-style accessor methods as well
Closes gh-26029
2020-11-04 16:51:54 +01:00
Sam Brannen 705cf09ad7 Merge branch '5.2.x' 2020-10-26 15:05:35 +01:00
Sam Brannen 449377908f Fix JUnit 4 to AssertJ migration bugs
The migration from JUnit 4 assertions to AssertJ assertions resulted in
several unnecessary casts from int to long that actually cause
assertions to pass when they should otherwise fail.

This commit fixes all such bugs for the pattern `.isNotEqualTo((long)`.
2020-10-26 14:53:09 +01:00
Juergen Hoeller 621295dbd8 Deprecate StringUtils.isEmpty(Object) and replace remaining usage
Closes gh-25945
2020-10-21 16:09:26 +02:00
Сергей Цыпанов 8a04910bdd Drop explicit zeroing at instantiation of Atomic* objects 2020-10-06 15:45:12 +02:00
Brian Clozel 61d893257e Rewrite "performance" test to JMH benchmarks
This commit rewrites the remaining "fastEnough" performance tests into
proper JMH benchmarks.

See gh-24830
2020-09-25 13:43:38 +02:00
Juergen Hoeller 3fd89c3ac1 Fix merge result
See gh-25706
2020-09-05 13:12:19 +02:00
Juergen Hoeller 9d7849c539 Merge branch '5.2.x'
# Conflicts:
#	spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java
2020-09-05 13:02:01 +02:00
Juergen Hoeller c368ce8223 Fix SpEL generated code for default method invocation
Closes gh-25706
2020-09-05 12:59:12 +02:00
Andy Clement a404bf5a94 Fix SpEL generated code for default method invocation
Closes gh-25706
2020-09-04 22:23:13 -07:00
Juergen Hoeller 874574513c Replace remaining usage of LinkedList with ArrayList/ArrayDeque
Closes gh-25650
2020-08-26 18:32:08 +02:00
XenoAmess 3b12beb1b8
Simplify if-statements with instanceof checks
Closes gh-25449
2020-07-22 10:34:27 +02:00
Sam Brannen 111899aa63 Add @Nullable declaration to getDefaultConstructor()
See gh-25367
2020-07-16 17:32:16 +02:00
Sam Brannen b0570cd3a6 Polish contribution
See gh-25367
2020-07-16 15:56:17 +02:00
Martin Knopf 35c0ae7b0c Allow auto grow for entries w/o default constructor in SpEL
Prior to this commit, The "auto grow" feature in SpEL expressions only
worked for element types with a default constructor. For example, auto
grow did not work for a list of BigDecimal elements.

This commit inserts a null value in the list when no default
constructor can be found for the element type.

Closes gh-25367
2020-07-16 15:31:33 +02:00
Sam Brannen 12e05280ad Upgrade to AssertJ 3.16 2020-05-06 15:22:23 +02:00
陈其苗 13970ae528 Use autoboxing instead of explicit wrapping in tests
Closes gh-24801
2020-04-01 14:34:20 +02:00
Sam Brannen e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Sam Brannen c3bc28762e Delete unused import in ExpressionLanguageScenarioTests
See gh-24586
2020-02-26 14:09:01 +01:00
ZhangT c5fb7b9fb7
Simplify some redundant code
Closes gh-24586

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-02-26 12:29:09 +01:00
Sam Brannen a9d9b76d09 Support SpEL compilation of interface methods again
Spring Framework 5.1.8 introduced a regression for the compilation of
SpEL expressions referencing a method declared in an interface. An
attempt to compile such an expression resulted in a
SpelEvaluationException caused by an IncompatibleClassChangeError.

This commit fixes this regression by adding explicit support in
ReflectivePropertyAccessor.OptimalPropertyAccessor.generateCode() for
methods declared in interfaces.

Closes gh-24357
2020-02-12 15:33:01 +01:00
Juergen Hoeller 259ffe9b3b Thread-safe compiled expression evaluation in SpelExpression
Closes gh-24265
2020-01-08 18:37:07 +01:00
Sam Brannen 4260c34b47 Rename test fixture package in spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sébastien Deleuze 7646895fd4 Support Kotlin synthetic classes in MethodParameter and SpEL
Closes gh-23812
2019-11-13 14:22:53 +01:00
stsypanov f5ae3c77c6 Use Method::getParameterCount where possible 2019-11-07 18:00:15 +01:00
Sam Brannen 734ceed301 Polish contribution
See gh-23658
2019-09-19 22:02:19 +02:00
i321222 fde7b1e545 Avoid ArrayIndexOutOfBoundsException in SpEL's Indexer
When index == arrayLength, the array index is also out of bounds.

For this scenario, a SpelEvaluationException should be thrown instead
of ArrayIndexOutOfBoundsException.

Closes gh-23658
2019-09-19 22:01:10 +02:00
Sam Brannen 2b460854ce Polishing 2019-09-12 13:16:48 +02:00
Sam Brannen e124cbb310 Fix Checkstyle violation 2019-09-12 13:15:58 +02:00
OLPMO 40fcf876ce Optimize test code with lambdas where feasible
This commit optimizes test code with lambda expressions
and method references where feasible.

Closes gh-23626
2019-09-12 13:09:31 +02:00
Sam Brannen 30cff46e7f Prevent improper use of testing framework APIs
Prior to this commit, a lot of work had been done to prevent improper
use of testing Framework APIs throughout the codebase; however, there
were still some loopholes.

This commit addresses these loopholes by introducing additional
Checkstyle rules (and modifying existing rules) to prevent improper use
of testing framework APIs in production code as well as in test code.

- Checkstyle rules for banned imports have been refactored into
  multiple rules specific to JUnit 3, JUnit 4, JUnit Jupiter, and
  TestNG.
- Accidental usage of org.junit.Assume has been switched to
  org.junit.jupiter.api.Assumptions.
- All test classes now reside under org.springframework packages.
- All test classes (including abstract test classes) now conform to the
  `*Tests` naming convention.
  - As an added bonus, tests in the renamed
    ScenariosForSpringSecurityExpressionTests are now included in the
    build.
- Dead JUnit 4 parameterized code has been removed from
  DefaultServerWebExchangeCheckNotModifiedTests.

Closes gh-22962
2019-09-12 11:20:56 +02:00
Sebastien Deleuze 72e92da2ad Make SpEL rootObject parameter nullable
Closes gh-23442
2019-08-29 11:02:31 +02:00