Author: richard.opalka(a)jboss.com
Date: 2011-02-25 09:42:00 -0500 (Fri, 25 Feb 2011)
New Revision: 13803
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/common/sort/DeploymentAspectSorter.java
Log:
workaround broken AS6 deployers sorting algorithm :(
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java 2011-02-25
13:18:13 UTC (rev 13802)
+++
common/trunk/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java 2011-02-25
14:42:00 UTC (rev 13803)
@@ -117,10 +117,6 @@
while (st.hasMoreTokens())
condset.add(st.nextToken());
}
- if (!isLast)
- {
- condset.add("WSObject");
- }
return condset;
}
@@ -133,10 +129,6 @@
while (st.hasMoreTokens())
condset.add(st.nextToken());
}
- if (isLast)
- {
- condset.add("WSObject");
- }
return condset;
}
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/sort/DeploymentAspectSorter.java
===================================================================
---
common/trunk/src/main/java/org/jboss/wsf/common/sort/DeploymentAspectSorter.java 2011-02-25
13:18:13 UTC (rev 13802)
+++
common/trunk/src/main/java/org/jboss/wsf/common/sort/DeploymentAspectSorter.java 2011-02-25
14:42:00 UTC (rev 13803)
@@ -54,8 +54,28 @@
public List<DeploymentAspect> sort(final List<DeploymentAspect> aspects)
{
- return this.createOrientedGraph(aspects).sort();
+ final DeploymentAspect lastAspect = getLastAspect(aspects);
+ final List<DeploymentAspect> sortedAspects =
createOrientedGraph(aspects).sort();
+ sortedAspects.add(lastAspect);
+ return sortedAspects;
}
+
+ private DeploymentAspect getLastAspect(final List<DeploymentAspect> aspects)
+ {
+ final Iterator<DeploymentAspect> i = aspects.iterator();
+ DeploymentAspect aspect;
+ while (i.hasNext())
+ {
+ aspect = i.next();
+ if (aspect.isLast())
+ {
+ i.remove();
+ return aspect;
+ }
+ }
+
+ throw new IllegalStateException("No deployment aspect found with attribute
last='true'");
+ }
private Graph createOrientedGraph(final List<DeploymentAspect> aspects)
{
Show replies by date