Struts 2
  1. Struts 2
  2. WW-3807

Sitegraph plugin tests broken on JDK 7

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.3
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
    • Environment:

      Ubuntu linux 12.04.
      Java version: 1.7.0_03, vendor: Oracle Corporation

      Description

      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

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Leonard Broman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development