2013/11/7  <ma...@apache.org>:
> Author: markt
> Date: Thu Nov  7 19:24:17 2013
> New Revision: 1539771
>
> URL: http://svn.apache.org/r1539771
> Log:
> Add a workaround for a Jira bug (to be removed later) as Jira is being used 
> for testing
>

Ordering of jars is important. The ones in <PreResources> should be
listed first.

(VirtualWebappLoader of Tomcat 7 can inject jars to be searched before
ones in WEB-INF/lib or after them, depending on configuration.  One
should be able to configure the same in Tomcat 8).


The same s/HashSet/LinkedHashSet/ is likely true for the
implementation of #listWebAppPaths() as well, though I am not sure
about an use case there.


One more note on #listWebAppPaths(), looking at a method that uses it:

Javadoc of method ApplicationContext.getResourcePaths(String) says
that the returned set is immutable. This statement is not true in
Tomcat 8, as far as I see it returns the created mutable HashSet as
is,

Actually, I do not see such immutability requirement in Javadoc of
ServletContext (neither in ours nor in the one at Oracle site),
http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html


> Modified:
>     tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java
>
> Modified: tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java?rev=1539771&r1=1539770&r2=1539771&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java 
> (original)
> +++ tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java Thu 
> Nov  7 19:24:17 2013
> @@ -24,6 +24,7 @@ import java.net.URISyntaxException;
>  import java.net.URL;
>  import java.util.ArrayList;
>  import java.util.HashSet;
> +import java.util.LinkedHashSet;
>  import java.util.Locale;
>  import java.util.Set;
>
> @@ -111,7 +112,10 @@ public class StandardRoot extends Lifecy
>          }
>
>          // Set because we don't want duplicates
> -        HashSet<String> result = new HashSet<>();
> +        // LinkedHashSet to retain the order (shouldn't matter but Jira is
> +        // sensitive to the order the JARs are returned in).
> +        // TODO - Revert to HashSet
> +        HashSet<String> result = new LinkedHashSet<>();
>          for (ArrayList<WebResourceSet> list : allResources) {
>              for (WebResourceSet webResourceSet : list) {
>                  if (!webResourceSet.getClassLoaderOnly()) {
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to