Commit Graph

95 Commits

Author SHA1 Message Date
Juergen Hoeller
75a9c45865 Polishing
Issue: SPR-12502
(cherry picked from commit 26845f6)
2014-12-30 10:13:03 +01:00
Juergen Hoeller
4c5e17ec3e Consistent resolution of Class methods and static methods
Issue: SPR-12502
(cherry picked from commit 9ef0bdc)
2014-12-07 23:56:06 +01:00
Juergen Hoeller
d5e4592728 Polishing 2014-11-02 11:19:54 +01:00
Juergen Hoeller
c0a4631fd1 Polishing 2014-07-29 10:10:48 +02:00
Juergen Hoeller
b0f7184f3f Polishing 2014-05-15 15:19:17 +02:00
Juergen Hoeller
9e2060707a General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
2014-04-27 22:29:08 +02:00
Juergen Hoeller
d8180e1e20 Correctly resolve accessors for static properties on Class
Issue: SPR-11609
(cherry picked from commit 3af8a32)
2014-03-26 21:57:35 +01:00
Juergen Hoeller
a25d67770e Added expression test case for constant on Map
Issue: SPR-11609
2014-03-26 21:11:49 +01:00
Juergen Hoeller
9585752693 Polishing 2014-03-11 21:36:10 +01:00
Juergen Hoeller
eeb82c409a SpEL property-not-found message hints at non-public method/field
Issue: SPR-11535
2014-03-11 10:47:53 +01:00
Stephane Nicoll
b1bcc5d6eb Fix double SPeL evaluation of parameter
When a node of an SPeL expression was a call to a bean referenced
 in a method argument, the expression was resolved twice.

 The resolved arguments are now specified to MethodValueRef instead
 of resolving the arguments again in the constructor

 Issue: SPR-11445
(cherry picked from commit 519799e)
2014-03-07 14:59:41 +01:00
Juergen Hoeller
75e08695a0 Mixed polishing along with recent changes
(cherry picked from commit 14e5a02)
2014-02-14 23:27:09 +01:00
Juergen Hoeller
ad91610796 Polishing
(cherry picked from commit 426f52b)
2014-02-06 23:27:46 +01:00
Juergen Hoeller
edb660863b Polishing 2014-01-24 16:59:42 +01:00
Juergen Hoeller
9aefa0334f Polishing 2014-01-16 18:28:50 +01:00
Juergen Hoeller
16bf501b30 Polishing 2014-01-16 17:53:26 +01:00
Juergen Hoeller
bfecbaf88e Clarified ArgsMatchKind deprecation 2014-01-15 15:46:46 +01:00
Juergen Hoeller
f18debb5a3 Fixed getTypeDifferenceWeight algorithm in ReflectionHelper, and deprecated ArgsMatchKind enum (for removal in 4.0)
Issue: SPR-11306
2014-01-15 15:15:39 +01:00
Juergen Hoeller
78646f1f32 Activated through rename to *Tests, and added method call interaction tests
Issue: SPR-7831
(cherry picked from commit 3bed6cf)
2014-01-03 23:02:18 +01:00
Juergen Hoeller
551364f668 Polishing 2013-12-20 00:40:14 +01:00
Phillip Webb
dfed8afb26 Only consider "is" methods with boolean returns
Fix regression introduced in b25e91a5 where ReflectivePropertyAccessor
does not consider the return type for "is" getters.

Issue: SPR-11142
(cherry picked from commit 85b0bfff)
2013-12-03 12:06:26 -08:00
Phillip Webb
f9f106936c Relax JavaBean rules for SpEL property access
Relax the method search algorithm used by `ReflectivePropertyAccessor`
to include methods of the form `getXY()` for properties of the form
`xy`.

Although the JavaBean specification indicates that a property `xy`
should use the accessors `getxY()` and `setxY()`, in practice many
developers choose to have an uppercase first character. The
`ReflectivePropertyAccessor` will now consider these style methods if
the traditional conventions fail to find a match.

Issue: SPR-10716
(cherry picked from commit b25e91a5)
2013-10-30 13:02:07 -07:00
Phillip Webb
5854d519a1 Add targetIsClass to SpEL property cache key
Update the `CacheKey` class used by `ReflectivePropertyAccessor` to
include if the target object is class. The prevents an incorrect cache
hit from being returned when a property with the same name is read on
both an object and its class. For example:

	#{class.name}
	#{name}

Issue: SPR-10486
(cherry picked from commit 6d882b14)
2013-10-30 13:02:07 -07:00
Juergen Hoeller
db056ae0e0 ExpressionState.getConfiguration() should never return null
Issue: SPR-11031
(cherry picked from commit 4aab315)
2013-10-26 15:55:13 +02:00
Phillip Webb
5d8aa635c6 Propagate EvaluationContext from LiteralExpression
Update getValue(EvaluationContext context, Object rootObject,
Class<T> desiredResultType) to propagate the EvaluationContext to
ExpressionUtils.

Issue: SPR-10953
(cherry picked from 686cd79)
2013-10-18 17:57:46 -07:00
Clément Plantier
d66cf0c32f Fix "Problem locating method" SpEL error message
Replace "Problem locating method {0} cannot on type {1}" with
"Problem locating method {0} on type {1}".

Issue: SPR-10928
(cherry picked from 824ac5)

Conflicts:
	spring-expression/src/main/java/org/springframework/expression/spel/SpelMessage.java
2013-09-20 11:50:30 -07:00
Juergen Hoeller
6110919842 Polished exception message 2013-09-04 22:11:11 +02:00
Juergen Hoeller
c5aa0d12b0 Polishing
Issue: SPR-9495
(cherry picked from commit baa698e)
2013-09-04 22:05:47 +02:00
Juergen Hoeller
6de67cc2df Only cache resolved method when coming from ReflectiveMethodResolver
Issue: SPR-9495
(cherry picked from commit b7ff26a)
2013-09-04 22:00:32 +02:00
Juergen Hoeller
b9d726fb84 Fixed EL resolution against static method with changing target class
Issue: SPR-10452
(cherry picked from commit 5e6044c)
2013-09-04 22:00:21 +02:00
Juergen Hoeller
0c30618ae8 Fixed getCachedExecutor race condition in MethodReference
This commit includes a full backport of the changes in SPR-10657, instead of just the initial commit which the original backport request referred to.

Issue: SPR-10884
Issue: SPR-10657
2013-09-02 15:33:15 +02:00
Phillip Webb
1e3dc4aeae Include argument types in MethodReference cache
Update the cached MethodExecutor in MethodReference to include the
method argument types. Prevents the incorrect use of the cache when the
SpEL expression refers to a class that has overloaded methods.

Issue: SPR-10657
(cherry picked from commit f9b12b8)
2013-07-25 11:28:03 +02:00
Juergen Hoeller
b2d416fd5f Revised ReflectiveMethodResolver to properly handle any kind of List returned from a MethodFilter
Issue: SPR-10392
(cherry picked from commit ad88650)
2013-05-07 22:07:29 +02:00
Juergen Hoeller
5bdd2d245c Consistent Map/Set ordering
Use LinkedHashMaps/Sets wherever exposed to users, and code tests defensively in terms of expected Map/Set ordering. Otherwise, there'll be runtime order differences between JDK 7 and JDK 8 due to internal HashMap/Set implementation differences.

Issue: SPR-9639
(cherry picked from commit 9c09a0a)
2013-04-30 23:29:03 +02:00
Juergen Hoeller
886cf825cb Added "getName()" accessor to MethodReference
Issue: SPR-10422
(cherry picked from commit 5ff2653)
2013-04-30 23:29:01 +02:00
Juergen Hoeller
aeef000c46 Fixed ReflectiveMethodResolver to avoid potential UnsupportedOperationException on sort
Issue: SPR-10392
2013-03-19 10:57:23 +01:00
Phillip Webb
18df9fed92 Fixed minor typo
Issue: SPR-10210
2013-02-28 15:37:10 -08:00
Phillip Webb
82bd06f255 Protect against missing SpEL selection expression
Update InternalSpelExpressionParser to ensure that SPeL selections
('$[...]', '^[...]', '?[...]') always include a nested expression.

Issue: SPR-10328
2013-02-25 14:28:18 -08:00
Phillip Webb
0b6101478e Use bridge methods in ReflectiveMethodResolver
Fix failing test

Issue: SPR-10210
2013-02-10 17:17:23 -08:00
Phillip Webb
634284e1fd Use bridge methods in ReflectiveMethodResolver
Update ReflectiveMethodResolver to consider bridge methods.

Issue: SPR-10210
2013-02-10 16:27:28 -08:00
Phillip Webb
1cc58e0a99 Limit auto grow collection size when using SpEL
Provide an additional constructor on SpelParserConfiguration that can
be used to limit the maximum size that a collection will auto grow when
being accessed via a SpEL expression.

This constraint is particularly useful when SpEL is used with data
binding as it prevents a malicious user from crafting a request that
causes OutOfMemory exceptions.

Issue: SPR-10229
2013-02-06 10:42:46 -08:00
Phillip Webb
f464a45ba4 Polish formatting
Minor formatting polish across that codebase. Primarily fixing
whitespace issues.
2013-02-04 10:35:25 -08:00
Phillip Webb
aac6b913d6 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Fix unnecessary @SupressWarnings annotations
  Fix Javadoc warnings
  Fix unused local variable warnings
  Fix unused type compiler warnings
  Fix 'is already an instance of type' warnings
2013-01-31 12:52:51 -08:00
Juergen Hoeller
7d798acd35 Added getOriginalValue() accessor to (Real)Literal
Issue: SPR-10248
2013-01-31 17:50:37 +01:00
Phillip Webb
065b1c0e46 Fix unused local variable warnings 2013-01-25 14:35:19 -08:00
Juergen Hoeller
abbe1db106 Polishing along with backport 2013-01-15 16:52:09 +01:00
Phillip Webb
ad91fa63fa SpEL support for static finals on interfaces
Update ReflectivePropertyAccessor to search for fields on super classes
and implemented interfaces.

Although the javadoc Class.getFields() implies that all public fields
of class should be returned SpelReproTests demonstrates that this is
not always the case.

Issue: SPR-10125
2013-01-14 15:49:38 -08:00
Phillip Webb
bff36fb145 Improve exceptions for multi-operand expressions
Fix SpEL expression parser and tokenizer to provide better exceptions
when dealing with operations that expect two operands. For example,
prior to this commit the expression '/foo' would throw a NPE due
to missing operands to the left of '/'.

Issue: SPR-10146
2013-01-14 14:07:26 -08:00
Phillip Webb
e4c1361c60 Remove accidentally committed interface @Override 2013-01-11 15:25:12 -08:00
Phillip Webb
e8fcde09ab Polish author and copyright year 2013-01-11 15:12:59 -08:00