| Summary: | ResourceRegistry should preserve order | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Austin Riddle <austin.riddle> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | cole |
| Version: | 1.3 | ||
| Target Milestone: | 1.3 M7 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Could you explain why that would matter? When filled from the o.e.rap.ui.resources extension, the order isn't predictable anyway. Are you having problems with dependencies of Javascript resources? It's been awhile, but I believe we were having issues with javascript dependencies being contributed by a single bundle. In this case the order is predictable since it gets preserved when read from the plugin.xml. The specific use case is where you have a 3rd party javascript library that needs to be loaded for use by a custom RAP widget. I don't remember the specifics, and it could possibly be avoided within the javascript itself. All I know is that we needed to add this to make it work at the time. For your convenience, I committed the proposed change. However, please note that the order in which resources are processed is still considered undefined. A mechanism to express dependencies or a way to let the application programmer define a set of resources is necessary to resolve this issue properly. Feel free to file a bugzilla for this. Moreover, the order in which the extensin registry returns extensions is also undefined and may change without prior notice. |
The ResourceRegistry should preserve the order that items were added in. ### Eclipse Workspace Patch 1.0 #P org.eclipse.rap.rwt Index: src/org/eclipse/rwt/internal/resources/ResourceRegistry.java =================================================================== RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/resources/ResourceRegistry.java,v retrieving revision 1.2 diff -u -r1.2 ResourceRegistry.java --- src/org/eclipse/rwt/internal/resources/ResourceRegistry.java 12 Jun 2008 13:12:16 -0000 1.2 +++ src/org/eclipse/rwt/internal/resources/ResourceRegistry.java 30 Mar 2010 21:16:44 -0000 @@ -11,8 +11,7 @@ package org.eclipse.rwt.internal.resources; -import java.util.HashSet; -import java.util.Set; +import java.util.*; import org.eclipse.rwt.internal.util.ParamCheck; import org.eclipse.rwt.resources.IResource; @@ -20,7 +19,7 @@ public final class ResourceRegistry { - private static final Set resources = new HashSet(); + private static final Set resources = new LinkedHashSet(); private ResourceRegistry() { // prevent instantiation