Leonard Broman created WW-3807:
----------------------------------
Summary: Sitegraph plugin tests broken on JDK 7
Key: WW-3807
URL: https://issues.apache.org/jira/browse/WW-3807
Project: Struts 2
Issue Type: Bug
Affects Versions: 2.3.3
Environment: Ubuntu linux 12.04.
Java version: 1.7.0_03, vendor: Oracle Corporation
Reporter: Leonard Broman
With JDK 7 the single sitegraph unit test fails to run. Unsure if this affects
deployments as different view implementations are used.
Test set: org.apache.struts2.sitegraph.SiteGraphTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.757 sec <<<
FAILURE!
testWebFlow(org.apache.struts2.sitegraph.SiteGraphTest) Time elapsed: 0.743
sec <<< ERROR!
java.lang.ClassCastException: org.apache.struts2.sitegraph.entities.Target
cannot be cast to java.lang.Comparable
at java.util.TreeMap.compare(TreeMap.java:1188)
at java.util.TreeMap.put(TreeMap.java:531)
at java.util.TreeSet.add(TreeSet.java:255)
at
org.apache.struts2.sitegraph.entities.FileBasedView.matchPatterns(FileBasedView.java:79)
at
org.apache.struts2.sitegraph.entities.FileBasedView.getTargets(FileBasedView.java:62)
at
org.apache.struts2.sitegraph.renderers.DOTRenderer.render(DOTRenderer.java:137)
at org.apache.struts2.sitegraph.SiteGraph.prepare(SiteGraph.java:122)
at
org.apache.struts2.sitegraph.SiteGraphTest.testWebFlow(SiteGraphTest.java:46)
Possible solutions:
Let entities.Target implement Comparable.
Use HashSet instead of TreeSet in FileBasedView.java:53 (with possible
performance losses)
Provide a Comparator to the TreeSet in FileBasedView.java:53
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira