Permalink
Browse files

Fix CombinedResourceHandler ordering bug in MyFaces

1 parent 9193db4 commit 96d5d171020e653d914e46578fd8bb4ea53b5502 @BalusC BalusC committed Sep 30, 2015
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/main/java/org/omnifaces/resourcehandler/CombinedResourceHandler.java
@@ -449,14 +449,18 @@ private void addCombined(FacesContext context, UIComponent component, String ren
String[] resourcePathParts = id.getName().split("\\.", 2)[0].split("/");
String resourceId = resourcePathParts[resourcePathParts.length - 1];
CombinedResourceInfo info = CombinedResourceInfo.get(resourceId);
+ boolean added = false;
if (info != null) {
for (ResourceIdentifier combinedId : info.getResourceIdentifiers()) {
- add(context, null, rendererType, combinedId, target);
+ add(context, added ? null : component, rendererType, combinedId, target);
+ added = true;
}
}
- componentResourcesToRemove.add(component);
+ if (!added) {
+ componentResourcesToRemove.add(component);
+ }
}
private void addStylesheet(FacesContext context, UIComponent component, ResourceIdentifier id) {

0 comments on commit 96d5d17

Please sign in to comment.