Commit 87e7db8
Optimize ParameterizedTypeImpl.getActualTypeArguments: remove defensive clone
Return direct reference to internal array instead of cloning on every call.
Callers read elements but do not modify the array, so cloning is unnecessary.
This optimization targets a hot spot from JFR profiling:
TypeUtilities ParameterizedTypeImpl.getActualTypeArguments accounted for
320 samples (39 percent of all getActualTypeArguments calls).
The constructor still clones the input array to prevent external modification.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 1521562 commit 87e7db8
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
| 504 | + | |
| 505 | + | |
505 | 506 | | |
506 | 507 | | |
507 | 508 | | |
| |||
0 commit comments