[
https://issues.apache.org/jira/browse/WW-5383?focusedWorklogId=897877&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-897877
]
ASF GitHub Bot logged work on WW-5383:
--------------------------------------
Author: ASF GitHub Bot
Created on: 03/Jan/24 13:02
Start Date: 03/Jan/24 13:02
Worklog Time Spent: 10m
Work Description: sepe81 commented on code in PR #830:
URL: https://github.com/apache/struts/pull/830#discussion_r1440429353
##########
plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java:
##########
@@ -24,69 +24,102 @@
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
-import com.opensymphony.xwork2.config.entities.*;
+import com.opensymphony.xwork2.config.entities.ActionConfig;
+import com.opensymphony.xwork2.config.entities.ExceptionMappingConfig;
+import com.opensymphony.xwork2.config.entities.InterceptorMapping;
+import com.opensymphony.xwork2.config.entities.PackageConfig;
+import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.AnnotationUtils;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.WildcardHelper;
import com.opensymphony.xwork2.util.classloader.ReloadingClassLoader;
-import com.opensymphony.xwork2.util.finder.*;
+import com.opensymphony.xwork2.util.finder.ClassFinder;
+import com.opensymphony.xwork2.util.finder.ClassFinderFactory;
+import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
+import com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate;
+import com.opensymphony.xwork2.util.finder.Test;
+import com.opensymphony.xwork2.util.finder.UrlSet;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsException;
-import org.apache.struts2.convention.annotation.*;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.AllowedMethods;
+import org.apache.struts2.convention.annotation.DefaultInterceptorRef;
+import org.apache.struts2.convention.annotation.ExceptionMapping;
+import org.apache.struts2.convention.annotation.ExceptionMappings;
+import org.apache.struts2.convention.annotation.Namespace;
+import org.apache.struts2.convention.annotation.Namespaces;
+import org.apache.struts2.convention.annotation.ParentPackage;
import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.regex.Pattern;
/**
- * <p>
* This class implements the ActionConfigBuilder interface.
- * </p>
*/
public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
private static final Logger LOG =
LogManager.getLogger(PackageBasedActionConfigBuilder.class);
+
+ private static final String DEFAULT_ACTION_SUFFIX = "Action";
+ private static final String DEFAULT_METHOD = "execute";
+
private static final boolean EXTRACT_BASE_INTERFACES = true;
+ /**
+ * Pattern to match the whole path with sub-path as on JDK9+
getClassLoader().getResources("")
+ * can return also a sub-path like "!/META-INF/versions/..."
+ */
+ private static final String EXCLUDE_ALL_JARS_PATTERN =
".*?\\.jar(!/|/)?(.*)?";
+ private static final String DEFAULT_SPLIT_PATTERN = "\\s*,\\s*";
Review Comment:
looks good without the original `[,]` 👍
Issue Time Tracking
-------------------
Worklog Id: (was: 897877)
Time Spent: 40m (was: 0.5h)
> Exclude JAR files by default when scanning for actions on JDK9+
> ---------------------------------------------------------------
>
> Key: WW-5383
> URL: https://issues.apache.org/jira/browse/WW-5383
> Project: Struts 2
> Issue Type: Improvement
> Components: Plugin - Convention
> Reporter: Lukasz Lenart
> Priority: Minor
> Fix For: 6.4.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> When running an app on the JDK9+ it can happen that the Convention plugin
> starts scanning JAR files due to changed behaviour of
> {{getClassLoader().getResources("")}} as this will also return additional
> path and current pattern to exclude JARs won't work.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)