[ 
https://issues.apache.org/jira/browse/WW-5674?focusedWorklogId=1033509&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1033509
 ]

ASF GitHub Bot logged work on WW-5674:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Aug/26 14:44
            Start Date: 03/Aug/26 14:44
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #1830:
URL: https://github.com/apache/struts/pull/1830#issuecomment-5167857066

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1830) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1830&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1830&issueStatuses=ACCEPTED)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1830&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [100.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1830&metric=new_coverage&view=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1830&metric=new_duplicated_lines_density&view=list)
  
     
   <!

Issue Time Tracking
-------------------

    Worklog Id:     (was: 1033509)
    Time Spent: 1h  (was: 50m)

> Cut the per-call allocations in SecurityMemberAccess.isClassBelongsToPackages
> -----------------------------------------------------------------------------
>
>                 Key: WW-5674
>                 URL: https://issues.apache.org/jira/browse/WW-5674
>             Project: Struts 2
>          Issue Type: Sub-task
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Sub-task of WW-5667.
> {{SecurityMemberAccess.isClassBelongsToPackages(Class, Set)}} runs on the 
> OGNL member-access hot path and allocates heavily on every call. It splits 
> the package name with a regex-based {{String.split("\\.")}}, wraps the result 
> in a {{List}}, then streams over the prefixes and builds a brand-new joined 
> {{String}} for every one of them before probing the set. For a class in 
> {{org.apache.struts2.ognl}} that is one array plus four {{String.join}} 
> allocations.
> It is invoked up to four times per {{isAccessible()}} call — once for the 
> excluded-package check and once for the allowlist check, for both the 
> member's declaring class and the target class (see 
> {{isExcludedPackageNames}}, {{isClassAllowlisted}}).
> This matches JFR sample 1 on the parent ticket:
> {noformat}
> java.lang.String.split(String)
> SecurityMemberAccess.isClassBelongsToPackages(Class, Set) :390
> SecurityMemberAccess.isExcludedPackageNames(Class) :386
> SecurityMemberAccess.isPackageExcluded(Class) :371
> {noformat}
> The same prefix-matching can be done by walking the package name from each 
> {{'.'}} and probing the set with a substring, with no array, stream, or join 
> allocations.
> This is the OGNL security gate, so the change must preserve exact allow/deny 
> semantics. Equivalence tests are required for: the default package (empty 
> package name), single-segment packages, exact matches, sub-package matches, 
> and near-misses that share a character prefix but not a package boundary 
> (e.g. {{org.apache.struts2x}} must not match {{org.apache.struts2}}).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to