[
https://issues.apache.org/jira/browse/WW-5622?focusedWorklogId=1013353&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1013353
]
ASF GitHub Bot logged work on WW-5622:
--------------------------------------
Author: ASF GitHub Bot
Created on: 04/Apr/26 13:31
Start Date: 04/Apr/26 13:31
Worklog Time Spent: 10m
Work Description: sonarqubecloud[bot] commented on PR #1650:
URL: https://github.com/apache/struts/pull/1650#issuecomment-4187122537
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1650)
**Quality Gate failed**
Failed conditions
 [25 Security
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1650&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [43.3% Coverage on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1650&metric=new_coverage&view=list)
(required ≥ 80%)
 [3.3% Duplication on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1650&metric=new_duplicated_lines_density&view=list)
(required ≤ 3%)
 [E Security Rating on New
Code](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1650)
(required ≥ A)
 [E Reliability Rating on New
Code](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1650)
(required ≥ A)
[See analysis details on SonarQube
Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1650)
##
 Catch issues before they fail your Quality Gate with our IDE extension
 [SonarQube for
IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
Issue Time Tracking
-------------------
Worklog Id: (was: 1013353)
Time Spent: 40m (was: 0.5h)
> Optimize Hibernate proxy detection to avoid repeated exception overhead when
> Hibernate is absent
> ------------------------------------------------------------------------------------------------
>
> Key: WW-5622
> URL: https://issues.apache.org/jira/browse/WW-5622
> Project: Struts 2
> Issue Type: Improvement
> Components: Core
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 6.9.0, 7.2.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> When Hibernate is not on the application classpath, Hibernate proxy detection
> methods throw and internally catch exceptions (NoClassDefFoundError in 6.x,
> LinkageError in 7.x) on every invocation. Applications with many distinct
> classes flowing through OGNL experience hundreds of thousands of caught
> exceptions, causing measurable performance degradation.
> h3. Impact
> The impact is most severe in Struts 6.x where
> {{com.opensymphony.xwork2.util.ProxyUtil}} lacks effective caching -
> {{isHibernateProxy()}} throws on nearly every call. Struts 7.x mitigates this
> partially via {{computeIfAbsent}} caching in {{StrutsProxyService}}, but
> still throws once per unique class/member.
> h3. Fix
> Detect Hibernate availability once at class-load time via {{Class.forName()}}
> and short-circuit all Hibernate-related methods immediately when absent. The
> existing {{try/catch}} blocks are retained as a safety net for partial
> classpath scenarios.
> h3. Affected Classes
> - 6.x: {{com.opensymphony.xwork2.util.ProxyUtil}}
> - 7.x: {{org.apache.struts2.util.StrutsProxyService}} and deprecated
> {{org.apache.struts2.util.ProxyUtil}}
> h3. Affected Methods
> - {{isHibernateProxy()}}
> - {{isHibernateProxyMember()}}
> - {{getHibernateProxyTarget()}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)