You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2022/09/15 06:19:00 UTC

[jira] [Closed] (WW-3807) Sitegraph plugin tests broken on JDK 7

     [ https://issues.apache.org/jira/browse/WW-3807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart closed WW-3807.
-----------------------------
    Resolution: Not A Problem

> 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
>            Priority: Major
>              Labels: jdk7
>             Fix For: 6.1.0
>
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)