struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1494876 - /struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
Date Thu, 20 Jun 2013 07:09:04 GMT
Author: lukaszlenart
Date: Thu Jun 20 07:09:04 2013
New Revision: 1494876

URL: http://svn.apache.org/r1494876
Log:
WW-4116 Reduces work when scanning packages

Modified:
    struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java

Modified: struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java?rev=1494876&r1=1494875&r2=1494876&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
(original)
+++ struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
Thu Jun 20 07:09:04 2013
@@ -562,16 +562,14 @@ public class PackageBasedActionConfigBui
      * @return true if class package is on the {@link #packageLocators} list
      */
     protected boolean checkPackageLocators(String classPackageName) {
-        if (packageLocators != null && !disablePackageLocatorsScanning) {
-            for (String packageLocator : packageLocators) {
-                if (classPackageName.length() > 0
-                        && (packageLocatorsBasePackage == null || classPackageName
+        if (packageLocators != null && !disablePackageLocatorsScanning &&
classPackageName.length() > 0
+                && (packageLocatorsBasePackage == null || classPackageName
                         .startsWith(packageLocatorsBasePackage))) {
-                    String[] splitted = classPackageName.split("\\.");
+            for (String packageLocator : packageLocators) {
+                String[] splitted = classPackageName.split("\\.");
 
-                    if (StringTools.contains(splitted, packageLocator, false))
-                        return true;
-                }
+                if (StringTools.contains(splitted, packageLocator, false))
+                    return true;
             }
         }
         return false;



Mime
View raw message