Created attachment 29522 [details] Test case implementation The implementation of web fragment sorting with relative ordering constraints may detect circular references, even though there is no such circle. This occurrence of this bug depends on the iteration order of the input map. Consider the attached test case, defining a simple chain of three web fragments: * web fragments a, b, c, with relative constraints "b after a", "c after b". * expected result: a, b, c * actual result: Testcase: testOrderWebFragmentsRelative4 took 0,002 sec Caused an ERROR Fragment relative ordering contains circular references. Thsi can be resolved by using absolute ordering in web.xml. java.lang.IllegalArgumentException: Fragment relative ordering contains circular references. Thsi can be resolved by using absolute ordering in web.xml. at org.apache.catalina.deploy.WebXml.orderWebFragments(WebXml.java:2190) at org.apache.catalina.deploy.TestWebXmlOrdering.testOrderWebFragmentsRelative4(TestWebXmlOrdering.java:268) Workaround: use absolute ordering. Details: * Java 1.7.0_07
Comment on attachment 29522 [details] Test case implementation Fix MIME type
What a lovely can of worms that was. All my own fault since I wrote the broken algorithm in the first place. I have re-written the sorting algorithm to address the issue identified in this report and a handful of other problems that emerged as I started to look for ways to break the existing algorithm. The test cases for relative ordering have be re-written so they test all 720 possible combinations of input order for each test and I have increased the number of test cases including several to cover the ordering highlighted in this test case. The fix has been made to trunk and 7.0.x and will be included in 7.0.33 onwards.
Great, thank you!