Commit e7a87ab
committed
ClassUtils: avoid overflow when injecting params
When Context.inject(Object) is called to inject parameters, it uses
ClassUtils.setValue, which calls the deprecated ConversionUtils.convert,
which leans on the statically linked ConvertService, which needs to
lazily load its Converter singleton plugins, which needs to inject those
singleton plugins with a context, which calls Context.inject(Object)...
To avoid this loop, this commit makes ClassUtils.setValue only call the
ConversionUtils.convert method as needed, rather than always. And in the
case of parameter injection, the types will always be compatible and
hence conversion will never be needed.
The cross-dependency between ClassUtils and ConversionUtils was always
suboptimal and now it finally bit us. In the near future, we will need
to deprecate ClassUtils.setValue in favor of a setFieldValue method of
the ConvertService.1 parent 4687d10 commit e7a87ab
1 file changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
430 | 431 | | |
431 | 432 | | |
432 | | - | |
433 | | - | |
434 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
435 | 445 | | |
436 | 446 | | |
437 | 447 | | |
| |||
0 commit comments