-
Bug
-
Resolution: Fixed
-
Medium
-
3.1
DefaultUserProfileServies#setServletContext relies on an implementation detail of some servlet containers that return a modifiable collection upon calling ServletContext#getResourcePaths. Since this is not guaranteed by the servlet spec a safer approach should be used as follows:
diff -r b525e9b6e14e -r 019c14125676 apps/confluence/confluence-project/confluence/src/java/com/atlassian/confluence/user/service/DefaultUserProfileService.java --- a/apps/confluence/confluence-project/confluence/src/java/com/atlassian/confluence/user/service/DefaultUserProfileService.java Fri Dec 18 23:45:51 2009 -0800 +++ b/apps/confluence/confluence-project/confluence/src/java/com/atlassian/confluence/user/service/DefaultUserProfileService.java Sat Dec 19 00:29:42 2009 -0800 @@ -14,6 +14,7 @@ import java.io.InputStream; import java.util.Set; +import java.util.HashSet; public class DefaultUserProfileService implements UserProfileService, ServletContextAware { @@ -55,7 +56,7 @@ @SuppressWarnings("unchecked") public void setServletContext(ServletContext servletContext) { - buildInProfilePics = servletContext.getResourcePaths(UserAccessor.PROFILE_PICTURE_BUILTIN_PATH); + buildInProfilePics = new HashSet<String>(servletContext.getResourcePaths(UserAccessor.PROFILE_PICTURE_BUILTIN_PATH)); CollectionUtils.filter(buildInProfilePics, new Predicate() { public boolean evaluate(Object object)
This patch allows Confluence 3.1 to work properly with GlassFish v3.