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

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

                Author: ASF GitHub Bot
            Created on: 21/Feb/26 08:32
            Start Date: 21/Feb/26 08:32
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart commented on code in PR #1586:
URL: https://github.com/apache/struts/pull/1586#discussion_r2835983424


##########
core/src/main/java/org/apache/struts2/util/ProxyUtil.java:
##########


Review Comment:
   done



##########
core/src/main/java/org/apache/struts2/util/StrutsProxyService.java:
##########
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.util;
+
+import org.apache.commons.lang3.reflect.ConstructorUtils;
+import org.apache.commons.lang3.reflect.FieldUtils;
+import org.apache.commons.lang3.reflect.MethodUtils;
+import org.apache.struts2.inject.Inject;
+import org.apache.struts2.ognl.OgnlCache;
+import org.apache.struts2.ognl.ProxyCacheFactory;
+import org.hibernate.Hibernate;
+import org.hibernate.proxy.HibernateProxy;
+import org.springframework.aop.TargetClassAware;
+import org.springframework.aop.framework.Advised;
+import org.springframework.aop.framework.AopProxyUtils;
+import org.springframework.aop.support.AopUtils;
+import org.springframework.aop.SpringProxy;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+
+import static java.lang.reflect.Modifier.isPublic;
+import static java.lang.reflect.Modifier.isStatic;
+
+/**
+ * Default implementation of {@link ProxyService}.
+ * Provides proxy detection and resolution for Spring AOP and Hibernate 
proxies.
+ *
+ * @since 7.2.0
+ */
+public class StrutsProxyService implements ProxyService {
+
+    private final OgnlCache<Class<?>, Boolean> isProxyCache;
+    private final OgnlCache<Member, Boolean> isProxyMemberCache;
+    private final OgnlCache<Object, Class<?>> targetClassCache;

Review Comment:
   right, fixed





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

    Worklog Id:     (was: 1006469)
    Time Spent: 2h 50m  (was: 2h 40m)

> Allow configuration of ProxyUtil for cache types
> ------------------------------------------------
>
>                 Key: WW-5514
>                 URL: https://issues.apache.org/jira/browse/WW-5514
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 6.6.0
>            Reporter: Jon Pulice
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 6.9.0, 7.2.0
>
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Since 6.6.0, the ProxyUtil class now always uses the WTLFU cache type when 
> creating its two internal caches. This means that the caffeine 
> library is now mandatory when it was not before.
> {code:java}
>   private static final OgnlCache<Class<?>, Boolean> isProxyCache = (new 
> DefaultOgnlCacheFactory(10000, OgnlCacheFactory.CacheType.WTLFU, 256))
>     .buildOgnlCache();
>   private static final OgnlCache<Member, Boolean> isProxyMemberCache = (new 
> DefaultOgnlCacheFactory(10000, OgnlCacheFactory.CacheType.WTLFU, 256))
>     .buildOgnlCache();{code}
>  
> Prior to 6.6.0, setting both of these configuration options would allow you 
> to omit the caffeine dependency from an application:
> {code:java}
> <constant name="struts.ognl.expressionCacheType" value ="basic" />
> <constant name="struts.ognl.beanInfoCacheType" value="basic" />{code}
>  
> Would it be possible to allow for the cache type used by the ProxyUtil class 
> to be configurable as well similar to the above?



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

Reply via email to