Commit Graph

207 Commits

Author SHA1 Message Date
Juergen Hoeller 99be15f58b Revise encoding steps towards use of JDK Charset and StandardCharsets
Issue: SPR-14492
2016-07-19 23:43:06 +02:00
Juergen Hoeller aaac199e8b Consistently use constructor-based instantiation instead of Class.newInstance / BeanUtils.instantiate
Issue: SPR-14486
2016-07-19 19:21:06 +02:00
Juergen Hoeller 6d91d54fc9 StandardTypeConverter initializes default ConversionService against volatile field
Issue: SPR-14465
2016-07-14 21:10:24 +02:00
Stephane Nicoll 2bf9bc312e Remove Guava cache support
This commit removes `GuavaCache` and support classes. Caffeine supersedes
the caching support in the Google Guava library with an actively maintained
Java 8+ version in standalone form.

As it is the only Guava feature Spring framework integrates with, this
commit removes effectively any reference to Guava.

Issue: SPR-13797
2016-07-08 10:57:05 +02:00
Juergen Hoeller a1f5fb53db Java 8 getParameterCount() instead of getParameterTypes().length
Issue: SPR-13188
2016-07-07 01:04:24 +02:00
Juergen Hoeller 39e3f2ebf6 MethodParameter supports Java 8 Executable/Parameter and validates parameter indexes
Also, equals insists on the same class now, differentiating from SynthesizingMethodParameter.

Issue: SPR-14055
Issue: SPR-13456
Issue: SPR-14438
2016-07-07 00:37:52 +02:00
Juergen Hoeller 102dc8a4dd Polishing 2016-07-06 15:29:15 +02:00
Stephane Nicoll e4b0486c5a Add @FunctionalInterface on candidate interfaces
Issue: SPR-14432
2016-07-06 14:32:13 +02:00
Sam Brannen 1391248ea6 Introduce log4j 2 for Spring's test suite
This commit adds a test runtime dependency on log4j 2 for every project
and migrates all log4j.properties files to log4j2-test.xml files.

Issue: SPR-14431
2016-07-05 19:19:09 +02:00
Stephane Nicoll 00d2606b00 Explicit type can be replaced by <>
Issue: SPR-13188
2016-07-05 17:00:34 +02:00
Juergen Hoeller 66ec1c1618 Add missing package-info files for common packages
Issue: SPR-14420
2016-06-30 21:39:06 +02:00
Andy Clement a31f0bb3c0 Fix compilation of expressions using instanceof and primitives
Prior to this commit the SpEL compiler would generate bad bytecode
if the left hand operand of an instanceof was a primitive or
if the right hand operand was a primitive type reference.
With the fixes primitives on the left hand side are now
correctly boxed and special handling is in place for when the
right hand side is a primitive type reference. Using a primitive
type reference on the right always causes the instanceof
check to return false.

Additionally a guard has been added such that compilation is
not allowed when the right hand side of an expression
is not a type reference. If it is, for example, a variable
reference that evaluates to a type reference then that
cannot be expressed in bytecode so compilation is not performed.

Issue: SPR-14250
2016-05-05 09:57:15 -07:00
Johnny Lim 44e652f99e Remove duplicate words
Closes gh-1039
2016-04-19 08:24:21 +02:00
Juergen Hoeller e38bfb1a68 Consistent public constructors in ast package
Issue: SPR-14181
2016-04-15 22:26:58 +02:00
Juergen Hoeller 4ae065996b Polishing
(cherry picked from commit aa5c12c)
2016-04-08 23:06:25 +02:00
Juergen Hoeller 54aeb7a5d6 Cache key classes implement Comparable and consistently provide a toString representation
Issue: SPR-14017
2016-03-26 14:32:10 +01:00
Juergen Hoeller 517ebd1d3e Consistent formatting 2016-03-24 19:22:50 +01:00
Sam Brannen 61824b1ade Remove trailing whitespace from source code 2016-02-29 18:52:57 +01:00
Juergen Hoeller 43bcab9c1a ReflectiveMethodResolver lets local static methods override java.lang.Class methods
Issue: SPR-13918
2016-02-08 13:23:02 +01:00
Andy Clement a12f23936c Allow use of '&' prefix to access factory bean in SpEL
Prior to this change SpEL did not have an syntactic
construct enabling easy access to a FactoryBean. With this
change it is now possible to use &foo in an expression when
the factory bean should be returned.

Issue: SPR-9511
2016-01-21 16:14:16 -08:00
Juergen Hoeller 21329df7e1 Polishing 2015-12-14 00:56:06 +01:00
Juergen Hoeller ef1e17fd15 Polishing 2015-12-13 01:14:38 +01:00
Juergen Hoeller 04f765506e Fine-tuned method/field access checks 2015-12-13 01:10:01 +01:00
Andy Clement a28fc760ba Fix SpEL compilation of static method/property/field operations
Before this change the compilation of a method reference or property/field
access was not properly cleaning up the stack if compilation meant
calling a static method or accessing a static field. In these cases there
is no need for a target object on the stack and it should be removed if
present. For a simple expression it is harmless since the end result of
the expression is the thing on the top of the stack, but for nested
expressions if the inner expression suffered this issue, the outer
expression can find itself operating on the wrong element.

The particular issue covered the case of a static field access but this
fix (and associated tests) cover static method, property and field access.

Issue: SPR-13781
2015-12-11 15:59:40 -08:00
Juergen Hoeller 11806b9215 Class identity comparisons wherever possible (and further polishing)
Issue: SPR-12926
2015-12-09 12:28:09 +01:00
Juergen Hoeller 8c4436926f Polishing 2015-11-26 02:09:37 +01:00
Juergen Hoeller fd84262e71 Polishing 2015-11-25 23:09:24 +01:00
Andy Clement 58756b023c Ensure cast correctly included for OpPlus compilation
When the plus operator is used between strings in a SpEL
expression and that expression is compiled, it is
important to include a cast if computation of any of
the operands isn't obviously leaving strings on the
stack. Likewise if the stack contents are known to
be strings, a cast should not be included.

Issue: SPR-12426
2015-11-24 16:35:08 -08:00
Juergen Hoeller 20a286b4d6 ASM ClassWriter uses application ClassLoader for its getCommonSuperClass check
Issue: SPR-13695
2015-11-24 17:38:02 +01:00
Juergen Hoeller 667fc7e4a9 Polishing 2015-09-04 14:38:47 +02:00
Sam Brannen b6c0e7cba3 Remove trailing whitespace in Java source code 2015-07-27 12:40:54 +02:00
Juergen Hoeller 34a81b605a PropertyOrFieldReference defensively catches Exception instead of just AccessException
Issue: SPR-13247
2015-07-20 13:04:34 +02:00
Juergen Hoeller 203f1225c3 Polishing 2015-07-17 15:25:43 +02:00
Juergen Hoeller 0783a1c667 SpEL selection/projection works with Iterable as well
Issue: SPR-13231
2015-07-15 11:22:52 +02:00
Juergen Hoeller ea2a1d33d9 Javadoc fixes plus additional polishing 2015-07-15 02:19:46 +02:00
Sam Brannen 3f0a6e814c Suppress warnings in spring-expression tests 2015-07-04 15:46:36 +02:00
Sam Brannen 078d252d1e Delete trailing whitespace in Java source code 2015-06-19 17:09:52 +02:00
Sam Brannen 7018747cec Remove trailing whitespace in Java source code 2015-05-29 02:03:44 +02:00
Andy Clement 91ed5b6b8c SpEL: ensure correct object used for nested #this references
Before this commit the object that #this would refer to in
nested expressions within projection/selection clauses was always
the root context object. This was incorrect as it should be the
element being projected/selected over. This commit introduces
a scope root context object which is set upon entering a new
scope (like when entering a projection or selection). Any
object. With this change this kind of expression now behaves:

where #this is the element of list1. Unqualified references
are also resolved against this scope root context object.

Issues: SPR-10417, SPR-12035, SPR-13055
2015-05-22 08:07:09 -07:00
Juergen Hoeller b4095c3e1d Class identity comparisons wherever possible
Issue: SPR-12926
2015-05-20 14:34:16 +02:00
Juergen Hoeller 9799df397a PropertyOrFieldReference avoids NPE through defensive copy of volatile accessor reference
Issue: SPR-13023
2015-05-13 15:45:48 +02:00
Sam Brannen 7a690df925 Remove trailing whitespace from Java source code 2015-05-06 20:08:42 +02:00
Andy Clement c382b6f059 Allow NEW and T to be used as unquoted map keys in SpEL
This change provides support for map[NEW], map[new], map[T]
and map[t]. Prior to this change the 'new' and 't' had to
be quoted because they were keywords in SpEL for a constructor
reference and type reference respectively.

Issue: SPR-11783
2015-03-30 16:20:04 -07:00
Juergen Hoeller 9d47a2b87e Explicit test for default useDistance mode
Issue: SPR-12808
2015-03-13 18:16:58 +01:00
Juergen Hoeller 348eb91891 ReflectiveMethodResolver applies useDistance mode by default (with fine-tuned varargs handling)
Issue: SPR-12803
Issue: SPR-12808
2015-03-11 22:09:03 +01:00
Sam Brannen d90cee78ef Remove trailing whitespace in source code 2015-03-07 21:16:18 +01:00
Andy Clement b7ef04767a Reduce SpEL compilation restrictions on mathematical expressions
Prior to this change the SpEL compiler would not compile mathematical
expressions where the operands were of differing types (e.g. int
and double). This required the expression writer to do the conversion
in the expression text. For example:

T(Integer).valueOf(someInt).doubleValue()/35d

With this commit the restriction is lifted and it is more like Java
so that you can simply do someInt/35d. The mathematical operators
affected are divide/plus/minus/multiply and modulus. This change
involved removing some guards so that the exitTypeDescriptor (the
trigger for whether compilation is allowed) is set more frequently
and enhancing bytecode generation to perform more sophisticated
conversion/coercion automatically.

Issue: SPR-12789
2015-03-06 10:32:42 -08:00
Stephane Nicoll babbf6e871 Harmonize resources location
Issue: SPR-12766
2015-02-28 10:32:40 +01:00
Eric Bottard ece7eb14ff Fix copy/paste error in Javadoc 2015-02-19 15:25:26 +01:00
Juergen Hoeller d34402d3ba OperatorMatches caches compiled patterns
Issue: SPR-12610
2015-01-20 16:02:11 +01:00