Commit Graph

6205 Commits

Author SHA1 Message Date
Chris Beams
e659deab4f Remove .aj sources from spring-aspects jar
Issue: SPR-10179
2013-01-16 08:56:06 +01:00
Chris Beams
19445508b3 Polish build.gradle 2013-01-16 08:55:58 +01:00
Chris Beams
26d5ef93e6 Handle non-void write methods deterministically
This change resolves a specific issue with processing
java.math.BigDecimal via ExtendedBeanInfo. BigDecimal has a particular
constellation of #setScale methods that, prior to this change, had the
potential to cause ExtendedBeanInfo to throw an IntrospectionException
depending on the order in which the methods were processed.

Because JDK 7 no longer returns deterministic results from
Class#getDeclaredMethods, it became a genuine possibility - indeed a
statistical certainty that the 'wrong' setScale method handling order
happens sooner or later. Typically one could observe this failure once
out of every four test runs.

This commit introduces deterministic method ordering of all discovered
non-void returning write methods in such a way that solves the problem
for BigDecimal as well as for any other class having a similar method
arrangement.

Also:

 - Remove unnecessary cast

 - Pass no method information to PropertyDescriptor superclasses when
   invoking super(...). This ensures that any 'type mismatch'
   IntrospectionExceptions are handled locally in ExtendedBeanInfo and
   its Simple* PropertyDescriptor variants where we have full control.

Issue: SPR-10111, SPR-9702
Backport-Commit: aa3e0be (forward-ported via cherry-pick from 3.1.x)
2013-01-16 08:11:55 +01:00
Rob Winch
6888a6f286 Restore *.aj whitespace
The removal of whitespace to the *.aj files made in 1762157 cause
NoSuchMethodError for code compiled against previous versions of
spring-aspects due to a bug in AspectJ (see SPR-10178 for details).

This commit reverts all the whitespace changes made in 1762157 which
resolves the NoSuchMethodErrors.

Issue: SPR-10178
2013-01-15 17:20:54 -06:00
Juergen Hoeller
e44b4b831e Further fixes for 3.2.1 2013-01-15 22:10:14 +01:00
Juergen Hoeller
2cd23a79a3 Polishing 2013-01-15 22:09:16 +01:00
Juergen Hoeller
450dbb2810 Reintroduced "mode" and "proxy-target-class" attributes in spring-task-3.1/3.2.xsd
Issue: SPR-10177
2013-01-15 22:05:21 +01:00
Juergen Hoeller
abbe1db106 Polishing along with backport 2013-01-15 16:52:09 +01:00
Juergen Hoeller
a3211782a6 AbstractCacheManager accepts no caches defined, allowing for EHCache default cache setup
Issue: SPR-7955
2013-01-15 15:54:14 +01:00
Sam Brannen
f3e5f8bb4e Update copyright year, author tags, and Javadoc 2013-01-15 12:11:44 +01:00
Sam Brannen
33ee0ea4a6 Fix broken test in ContentAssertionTests 2013-01-15 11:56:27 +01:00
Rossen Stoyanchev
b2d6596901 Add contentTypeCompatibleWith option to Spring MVC Test
An expectation such as content().contentType(MediaType.TEXT_PLAIN)
fails if the actual media type contains a charset or another parameter.
A new method allows comparing the media type and subtype only via
content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN).

Issue: SPR-10165
2013-01-14 22:00:55 -05:00
Rossen Stoyanchev
9dc7b5feef Use MessageSource to resolve @ResponseStatus.reason
The reason attribute of @ResponseStatus can now be a code resolvable
through the ApplicationContext's MessageSource.

Issue: SPR-6044
2013-01-14 22:00:55 -05:00
Rossen Stoyanchev
a16bad04f0 Update Validation chapter
The Validation chapter now includes information on combining JSR-303
Bean Validation with additional Spring Validator's that don't require
the use of annotations.

Issue: SPR-9437
2013-01-14 22:00:54 -05:00
Rossen Stoyanchev
ad025b59c5 Prepend context/servlet path to FormTag action
The Form tag now fills in the context and servlet path if not present
in the specified action.

Issue: SPR-8684
2013-01-14 22:00:54 -05: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
d40bd8bd19 Tweak eclipse warning settings
Hide raw-type, generic and resource leak warnings.
2013-01-14 11:43:58 -08:00
Phillip Webb
8bb67149a7 Fix eclipse .settings generation
Fix issues where gradle would not regenerate .settings files due to
the task being considered UP-TO-DATE.
2013-01-14 11:42:12 -08:00
Phillip Webb
f57c24cd8c Allow 'gradle eclipse' without 'cleanEclipse'
Allow eclipse projects to be regenerated without first requiring the
'gradle cleanEclipse' task to be executed.
2013-01-14 10:25:33 -08:00
Sam Brannen
8694a0aac0 Minor changes to AnnotationUtils
- Polished Javadoc for isAnnotationDeclaredLocally() and
  isAnnotationInherited().
- Removed unnecessary call to Arrays.asList() in
  isAnnotationDeclaredLocally().
2013-01-14 12:24:12 +01:00
Sam Brannen
8a37521a3c Fix copyright year & method names in spring-test
This commit fixes the copyright year for changes made in commit
5b147bfba8. In addition, method names
have been changed to reflect the semantic changes made in that same
commit.
2013-01-14 11:40:21 +01: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
Phillip Webb
fce7adc400 Consider bridge methods in SpEL properties
Revert ReflectivePropertyAccessor changes from 107fafb and instead
consider all methods when resolving properties. Methods are now
sorted such that non-bridge methods are considered before bridge
methods.

Issue: SPR-10162
2013-01-11 15:07:06 -08:00
Phillip Webb
5ddc313bef Upgrade to prop-deps gradle plugin 0.0.3 2013-01-11 15:07:06 -08:00
Rossen Stoyanchev
54c873b4c4 Support multiple Validators in DataBinder
DataBinder now allows registering additional Validator instances.
This may be useful when adding a Spring Validator to a globally
registered JSR-303 LocalValidatorFactoryBean.

Issue: SPR-9436
2013-01-11 16:28:19 -05:00
Juergen Hoeller
f0a1ff2d76 JDBC parameter binding uses JDBC 3.0 ParameterMetaData (if available) for type determination
Forward-ported from 3.1.2, with minor modifications for defensiveness against the JDBC driver.

Issue: SPR-10084
2013-01-11 21:55:57 +01:00
Phillip Webb
68970b7902 Merge branch 'SPR-9518' into 3.2.x
* SPR-9518:
  Generate eclipse project settings from gradle
2013-01-11 12:43:25 -08:00
Phillip Webb
2db7a12288 Generate eclipse project settings from gradle
Update gradle to generate the following project specific eclipse
settings:

- Java formatting
- Cleanup options
- Warning settings
- Code template with copyright header
- WTP module meta-data

In addition this commit changes the eclipse project .classpath file
to output test and main classes to different folders. This is required
to prevent eclipse WTP from packaging test classes into /WEB-INF/lib
jar files.

Issue: SPR-9518
2013-01-11 12:43:16 -08:00
Sam Brannen
5b147bfba8 Improve speed of spring-test build
- Now excluding *TestSuite classes from the JUnit test task.
- Renamed SpringJUnit4SuiteTests to SpringJUnit4TestSuite so that it is
  no longer executed in the build.
- Reduced sleep time in various timing related tests.
2013-01-11 21:31:46 +01:00
Phillip Webb
c1fe3c056a Polish DetectSplitPackagesPlugin
Polish DetectSplitPackagesPlugin to favor double-quoted strings.
2013-01-11 12:19:52 -08:00
Chris Beams
bfdc191035 Merge branch 'SPR-10093' into 3.2.x
* SPR-10093:
  Polish changes from pull request #205
2013-01-11 16:35:08 +01:00
Chris Beams
74137794da Polish changes from pull request #205
- Replace space intendation with tabs
 - Remove leading tabs on otherwise empty lines
 - Remove illegal {@link ...} syntax in Javadoc @see reference

Issue: SPR-10093
2013-01-11 16:32:52 +01:00
Chris Beams
54d2846816 Merge pull request #214 from glyn/SPR-9990
# By Chris Beams (2) and others
* SPR-9990:
  Refactor detect-split-packages Gradle plugin
  Replace space indentation with tabs
  Rework split package detection code
  Example SplitPackageDetectorPlugin
  Detect split packages at build time
2013-01-11 15:55:33 +01:00
Chris Beams
654c07db34 Refactor detect-split-packages Gradle plugin
- Use conventional plugin naming, i.e. "detect-split-packages" instead
   of applying plugin based on fully-qualified class name

 - Rename "diagnose" => "detect" consistently throughout plugin, task
   and method names and generally refactor naming throughout to follow
   "detect split packages" phrasing

 - Add Javadoc to DetectSplitPackagesPlugin

 - Improve error reporting when split packages are detected

   Upon detecting one or more split packages, `detectSplitPackages` now
   fails idiomatically, throwing a GradleException to signal task failure
   (as opposed to the previous approach of using an assert assertion), and
   the output reads as follows:

       $ gradle detectSplitPackages
       [...]
       :buildSrc:build UP-TO-DATE
       :detectSplitPackages FAILED

       FAILURE: Build failed with an exception.

       * What went wrong:
       Execution failed for task ':detectSplitPackages'.
       > The following split package(s) have been detected:
          - org.springframework.beans (split across spring-beans and spring-orm)
          - org.springframework.core.env (split across spring-context and spring-core)

 - DetectSplitPackagesTask now automatically attaches itself to `check`
   task lifecycle if the enclosing project contains a `check` task

 - DetectSplitPackagesTask adds itself to the 'Verification' task group,
   ensuring that it shows up correctly in `gradle tasks` task listings

 - packagesToScan now defaults to all subprojects; users may then
   customize this by removing individual subprojects from the collection

Issue: SPR-9990
2013-01-11 15:54:11 +01:00
Chris Beams
b8f408ed5f Replace space indentation with tabs
Issue: SPR-9990
2013-01-11 15:44:00 +01:00
Phillip Webb
c425d22151 Exclude eclipse WTP generated artifacts 2013-01-10 23:17:49 -08:00
Phillip Webb
a0e5394203 Exclude stax test dependency
Exclude transitive stax 1.0 dependency to prevent compile time
eclipse errors.
2013-01-10 23:17:34 -08:00
Sam Brannen
18bf860c27 Update Javadoc for MockMvc
Deleted reference to the obsolete configureWarRootDir() method from the
stand-alone spring-test-mvc project.
2013-01-11 00:31:37 +01:00
Rob Winch
91da138314 Use explicit JDK versions in aspects.gradle
Previously aspects.gradle used the Gradle conventions for the source
and target compatibility. This means that unless the conventions were
updated the current JDK would be used for both source and target
compatibilty. Since an update to build.gradle changed to configure the
compileJava and compileTestJava tasks explicitly spring-aspects has
been compiled with JDK 7 compatibility.

This commit explicitly uses the source and target compatibility from
spring-core to ensure that aspects.gradle is kept up to date.

Issue: SPR-10161
2013-01-10 15:40:22 -06:00
Sam Brannen
2427391286 Polish Javadoc in CookieValue and RequestHeader 2013-01-10 17:33:59 +01:00
Juergen Hoeller
ea823fd398 AnnotationAwareOrderComparator etc 2013-01-10 17:01:18 +01:00
Juergen Hoeller
e806c4eb3d AnnotationAwareOrderComparator is able to sort Class objects as well
Issue: SPR-10152
2013-01-10 17:00:46 +01:00
Juergen Hoeller
dae4485155 Added dedicated sort method to AnnotationAwareOrderComparator
Issue: SPR-9625
2013-01-10 17:00:45 +01:00
Juergen Hoeller
f6d7518013 SpringContextResourceAdapter implements equals/hashCode according to the JCA 1.5 contract
Issue: SPR-9162
2013-01-10 17:00:44 +01:00
Juergen Hoeller
5e8e901aba FreeMarkerConfigurationFactory properly supports TemplateLoaders when recreating Configurations
Issue: SPR-9389
2013-01-10 17:00:43 +01:00
Juergen Hoeller
f8a7cf9f51 MimeMessageHelper encodes attachment filename if not ASCII compliant
Issue: SPR-9258
2013-01-10 17:00:42 +01:00
Juergen Hoeller
97ae403b53 AbstractAdvisingBeanPostProcessor caches per bean target class, working for null bean names as well
Issue: SPR-10144
2013-01-10 17:00:41 +01:00
Juergen Hoeller
3a9ca4a6bb MessageSourceResourceBundle overrides JDK 1.6 containsKey method, avoiding NPE in getKeys
Issue: SPR-10136
2013-01-10 17:00:40 +01:00