Commit Graph

171 Commits

Author SHA1 Message Date
Rossen Stoyanchev bdac937a43 Replace more references to issue tracker
Fixes #22254
2019-01-17 17:08:39 -05:00
Stephane Nicoll 9cbd585c30 Polish "Join identical catch branches"
Closes gh-2052
2018-12-25 09:46:35 +01:00
igor-suhorukov a218bf40cd Join identical catch branches
See gh-2052
2018-12-25 09:46:11 +01:00
Rossen Stoyanchev 38ae282c3b Update log category precision for all tests
Replace the full category capped at 36 chars with the class name only
and 1 char per package, e.g. org.apache.commons.Foo -> o.a.c.Foo
2018-12-12 11:40:33 -05:00
Hanope bfb49c7249 Fix typos
See gh-2019
2018-11-19 08:41:21 +01:00
Juergen Hoeller 3abebb3799 Polishing 2018-09-07 13:23:22 +02:00
Juergen Hoeller 90a4740279 Polishing 2018-09-07 12:56:53 +02:00
Andy Clement f87a37fd0d Fix SpEL compilation for non trivial elvis operand
Issue: SPR-17214
2018-09-05 09:41:13 -07:00
Juergen Hoeller c4df335a1d ReflectiveMethodExecutor invokes interface method if possible
Issue: SPR-16845
2018-07-19 16:35:59 +02:00
Phillip Webb a89e716cc7 Use tabs rather than spaces in tests
Update tests to ensure that tabs are used instead of spaces. Also
consistently apply a new line at the end of each file.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 1c25cec44f Polish test code
Polish a few issue identified when adding checkstyle to the
build. Although checkstyle is not enforcing rules on tests,
these are a few minor changes that are still worth making.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Juergen Hoeller ac1e2a4598 Consistent SpelEvaluationException messages in findAccessorForMethod
Includes abstract declarations for FormatHelper and ReflectionHelper.

Issue: SPR-16762
2018-05-01 23:48:26 +02:00
Juergen Hoeller d4a55a257b OperatorMatches flags misguided evaluation attempts as FLAWED_PATTERN
Issue: SPR-16731
2018-04-17 11:10:15 +02:00
Juergen Hoeller b2d87abcbb Polishing 2018-03-28 12:06:38 +02:00
Juergen Hoeller c60cefa331 SimpleEvaluationContext.Builder withRootObject/withTypedRootObject
Issue: SPR-16588
2018-03-27 00:22:54 +02:00
Juergen Hoeller 9128226da4 SimpleEvaluationContext.Builder withMethodResolvers/withInstanceMethods
Includes DataBindingMethodResolver as ReflectiveMethodResolver subclass.

Issue: SPR-16588
2018-03-24 16:30:37 +01:00
Juergen Hoeller 51c57d77d9 SimpleEvaluationContext with dedicated factory methods for common cases
Aligned with DataBindingPropertyAccessor and shown in ref doc examples.

Issue: SPR-16588
2018-03-22 18:09:27 +01:00
Juergen Hoeller b5511645b8 DataBindingPropertyAccessor with factory methods (forReadOnlyAccess etc)
Includes configurable write support at ReflectivePropertyAccessor level.

Issue: SPR-16588
2018-03-22 00:03:06 +01:00
Juergen Hoeller c1405ef140 Polishing 2018-03-21 16:12:42 +01:00
Juergen Hoeller 639d2c6fe7 Polishing 2018-03-21 12:39:15 +01:00
Juergen Hoeller 1fd5935afa SimplePropertyAccessor with configurable write support
Issue: SPR-16588
2018-03-21 12:06:40 +01:00
Andy Clement 1db7e02de3 Modify SpEL code gen to take account of null safe refs
With this change the code generation for method and property
references is modified to include branching logic in the
case of null safe dereferencing (?.). This is complicated
by the possible usage of primitives on the left hand side
of the dereference. To cope with this case primitives are
promoted to boxed types when this situation occurs enabling
null to be passed as a possible result.

Issue: SPR-16489
2018-03-12 15:58:59 -07:00
Juergen Hoeller c543368aad Polishing 2018-03-03 17:33:48 +01:00
igor-suhorukov 06fef1e5a4 Polish: assertion arguments should be passed in the correct order 2018-03-03 16:14:45 +01:00
Juergen Hoeller fa670dd07d Indexer enforces target descriptor only after non-null target check
Issue: SPR-16544
2018-03-01 13:31:56 +01:00
Juergen Hoeller 3b810f3544 Consistent Class array vs vararg declarations (and related polishing) 2018-02-14 14:44:00 +01:00
Juergen Hoeller d5cabca2f7 Internal adaptation to Deque semantics 2018-02-12 15:55:09 +01:00
Juergen Hoeller b5bd977d9a Revised assertion refactoring in AbstractExpressionTests 2018-02-10 18:17:40 +01:00
igor-suhorukov 0ee505b73e Polish: assertion arguments should be passed in the correct order,
use assertNull instead of assertEquals(null, value),
declare delta as double value in assertEquals
2018-02-10 17:17:28 +01:00
Juergen Hoeller 4a57e26d76 Polishing 2018-01-07 23:33:35 +01:00
Juergen Hoeller c30145d6f9 MethodReference treats proxy-targeting expressions as non-compilable
Issue: SPR-16191
2017-11-13 23:00:53 +01:00
Juergen Hoeller 78284a62e2 Polishing 2017-10-27 15:28:51 +02:00
Juergen Hoeller 419b4440a7 Introspect interface-declared methods in case of proxy (for varargs)
Issue: SPR-16122
2017-10-27 10:52:44 +02:00
Juergen Hoeller fd6f2bd6a4 Test for null value against boolean property
Issue: SPR-16123
2017-10-26 22:49:34 +02:00
Juergen Hoeller 03b68286a2 Tokenizer uses single process step and length-based exhaustion check
Issue: SPR-16032
2017-10-04 12:23:16 +02:00
Juergen Hoeller 7ae59d0c2a Nullability refinements on private and static methods
Based on IntelliJ IDEA 2017.3 introspection results.

Issue: SPR-15756
2017-09-22 18:22:14 +02:00
Juergen Hoeller efc5b47b9a Polishing 2017-07-14 17:37:06 +02:00
Juergen Hoeller 1ad6180019 Expression javadoc alignment 2017-07-14 16:46:22 +02:00
Juergen Hoeller bcf9f21ecc PropertyOrFieldReference checks cached PropertyAccessor against current EvaluationContext
Issue: SPR-15769
2017-07-14 15:18:05 +02:00
Juergen Hoeller cc74a2891a @Nullable all the way: null-safety at field level
This commits extends nullability declarations to the field level, formalizing the interaction between methods and their underlying fields and therefore avoiding any nullability mismatch.

Issue: SPR-15720
2017-06-30 01:54:16 +02:00
Juergen Hoeller f813712f5b Consistent use of @Nullable across the codebase (even for internals)
Beyond just formally declaring the current behavior, this revision actually enforces non-null behavior in selected signatures now, not tolerating null values anymore when not explicitly documented. It also changes some utility methods with historic null-in/null-out tolerance towards enforced non-null return values, making them a proper citizen in non-null assignments.

Some issues are left as to-do: in particular a thorough revision of spring-test, and a few tests with unclear failures (ignored as "TODO: NULLABLE") to be sorted out in a follow-up commit.

Issue: SPR-15540
2017-06-07 14:19:15 +02:00
Andy Clement c1edb3b5bd Enforce limit on classes loaded by Spel compiled expression loader
Until this change a single classloader was used to load
all compiled SpEL expressions. This meant in a context where an
expression was repeatedly flipping between compiled and interpreted
mode (which can happen if in MIXED mode compilation and changing
the context around the evaluation) the classloader would continually
load a new compiled version but not orphan the old compiled version.
This eventually uses up all the memory as the number of classes
is ever increasing.

With this change classloaders are used to load 100 compiled
expressions. The 101st will be loaded by a new one. Orphaning the
old classloader means if an expression is ever recompiled there
is more likely to be no anchored references left to the older
compiled form and it can be GC'd. In the MIXED situation above it
should help alleviate the problem of older classes never being
candidates for GC.

Issue: SPR-15460
2017-04-27 11:31:56 -07:00
Juergen Hoeller 214d0d76a5 Polishing 2017-02-18 01:01:35 +01:00
Christoph Dreis 5cfa7e71bb Use Class.getTypeName() where appropriate
Issue: SPR-15237
2017-02-08 20:36:41 +01:00
Andy Clement d41d28f8ce Fix compilation of SpEL elvis/ternary expressions
Without this fix the compiled version of elvis
actual behaved differently to the interpreted version
if the value being queried was an empty string. This
is now fixed. It also now correctly handles the
query value being a primitive and addresses the
findings of SPR-15192 where some type inferencing
logic was trying to be too clever, that code has
been deleted.

Issue: SPR-15192
2017-02-06 09:43:10 -08:00
Juergen Hoeller 14eba5034d Consistent ExpressionException-style quoting of expression string and position
Issue: SPR-14942
2016-11-24 11:08:55 +01:00
Juergen Hoeller 3e419cde7d Polishing
Issue: SPR-14863
2016-11-02 12:44:12 +01:00
Juergen Hoeller 82fa4ef274 Polishing
Issue: SPR-14863
2016-11-02 11:45:59 +01:00
Andy Clement 9000acd39d Rework compilation of OpNE/OpEQ SpEL operators
For SPR-14863 we need to adjust the code generation for OpNE
to use !x.equals(y) rather than x!=y. There are also further
cases in the equalityCheck() code in Operator that were not
being handled in the compilation case (when comparators are
used for example). This latter issue also affects OpEQ.

Rather than add yet more bytecode generation, both OpNE and
OpEQ generateCode() methods have been simplified. The
generated code now delegates to equalityCheck() in Operator
which is exactly what the interpreted case does.

This ensures that the compiled code continues to behave just
like the interpreted case. It ensures changes to the interpreted
case are automatically picked up for the compiled case. It
makes the bytecode generation simpler.

The benefit of compilation of SpEL expressions is to avoid
slow reflective calls - that doesn't apply for a basic
(in)equality test so there is no need to go crazy in bytecode
gen.

Issue: SPR-14863
2016-11-01 13:42:23 -07:00
Sam Brannen d6d05e8ca0 Remove trailing whitespace in Java source code 2016-08-29 15:25:10 +02:00