Skip to content

Bypass conversion when possible [SPR-9566] #14200

@spring-projects-issues

Description

@spring-projects-issues

Gary Russell opened SPR-9566 and commented

  1. A Map<?,?> that doesn't need conversion and does not have a no-arg constructor causes execution failure (works in 3.0). (INT-2630)
  2. A large byte[] is unnecessarily copied, causing high cpu utilization (not copied in 3.0). (INT-2650).

A simple example showing #2 is provided in spring-framework-issues is shown here (to-be-supplied).

The parameter 'argumentsRequiringConversion' to ReflectionUtils.convertArguments is completely ignored.

Before reading #13163, I tried "fixing" this method, as shown here (to-be-supplied). This fixed the problem, but broke ExpressionTestsUsingCoreConversionService.testConvert, because the logic in ReflectiveMethodResolver.resolve, for the test case that fails (with my patch to ReflectionHelper), considers "Collection<String> foos" a "close match" to the parameter in the method

public void setFoos(Collection<Foo> foos)

which results in argumentsRequiringConversion being null. Seems to me this shouldn't be a CLOSE match, but a REQUIRES_CONVERSION match, in which case my suggested fix to ReflectionUtils would work.

We can work around these issues in Spring Integration, but the core issue remains.


Affects: 3.1.1

Reference URL: http://forum.springsource.org/showthread.php?127694-TCP-Endpoint-binary-incoming-transfer-high-cpu-load

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions