Skip to content

Comments

WW-5614 Remove cache for ProxyUtil#ultimateTargetClass#1578

Merged
kusalk merged 1 commit intomainfrom
WW-5614-proxy-memory
Feb 12, 2026
Merged

WW-5614 Remove cache for ProxyUtil#ultimateTargetClass#1578
kusalk merged 1 commit intomainfrom
WW-5614-proxy-memory

Conversation

@kusalk
Copy link
Member

@kusalk kusalk commented Feb 12, 2026

WW-5614

Fixes potential excessive memory usage caused by this cache, first reported here.

It would be better to retain the cache (for performance) and make the keys weak references (to optimise memory usage) but I will await the merge of #1573 first as the changes will likely conflict.

@kusalk kusalk requested a review from lukaszlenart February 12, 2026 01:53
@kusalk kusalk marked this pull request as ready for review February 12, 2026 01:53
@sonarqubecloud
Copy link

@kusalk kusalk merged commit fe69771 into main Feb 12, 2026
10 checks passed
@kusalk kusalk deleted the WW-5614-proxy-memory branch February 12, 2026 10:58
@lukaszlenart lukaszlenart added this to the 7.2.0 milestone Feb 13, 2026
lukaszlenart added a commit that referenced this pull request Feb 21, 2026
Remove targetClassCache from StrutsProxyService to avoid memory leak
(object-keyed cache reintroduced from PR #1578). Change default proxy
cache type to wtlfu to align with all other caches. Switch deprecated
ProxyUtil static caches to BASIC to remove hard Caffeine dependency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lukaszlenart added a commit that referenced this pull request Feb 21, 2026
)

* feat(proxy): WW-5514 add StrutsProxyService for proxy detection and resolution

Introduces a configurable ProxyService interface and StrutsProxyService
implementation for detecting and resolving Spring AOP/Hibernate proxies.

Key changes:
- Add ProxyService interface with isProxy, ultimateTargetClass, and
  resolveTargetMember methods
- Add StrutsProxyService implementation using configurable caches
- Add ProxyCacheFactory and StrutsProxyCacheFactory for cache management
- Integrate ProxyService into ChainingInterceptor, ParametersInterceptor,
  and SecurityMemberAccess
- Add integration test with Spring AOP proxied action chaining
- Add configuration constants for proxy cache type and size

The StrutsProxyService correctly handles:
- Spring CGLIB proxies (class-based)
- Spring JDK dynamic proxies (interface-based)
- Hibernate entity proxies
- Member resolution for allowlist checking

Fixes WW-5514

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* test(proxy): WW-5514 add ProxyService integration tests for Spring proxies

Add integration tests to SpringProxyUtilTest that verify the new
ProxyService works correctly with real Spring AOP proxies, alongside
the existing deprecated ProxyUtil tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(proxy): WW-5514 address PR review feedback for proxy caches

Remove targetClassCache from StrutsProxyService to avoid memory leak
(object-keyed cache reintroduced from PR #1578). Change default proxy
cache type to wtlfu to align with all other caches. Switch deprecated
ProxyUtil static caches to BASIC to remove hard Caffeine dependency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants