-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: dashboard-view-plugin
-
None
-
Environment:Jenkins: 1.572
SO: Ubuntu 12.04 LTS
-
dashboard-view 2.9.4
After the last updates the portlet throw the next error:
WARNING: Caught exception evaluating: it.getUnstableJobs(jobs) in /. Reason: java.lang.ClassCastException: hudson.maven.MavenModule cannot be cast to hudson.model.TopLev elItem
java.lang.ClassCastException: hudson.maven.MavenModule cannot be cast to hudson.model.TopLevelItem
at hudson.plugins.view.dashboard.core.UnstableJobsPortlet.getUnstableJobs(UnstableJobsPortlet.java:44)
at hudson.plugins.view.dashboard.core.UnstableJobsPortlet.getUnstableJobs(UnstableJobsPortlet.java:46)
at sun.reflect.GeneratedMethodAccessor597.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Seeing the conde and the class hierarchy, I think that the correct method signature for getUnstableJobs is:
public Collection<Job> getUnstableJobs(Collection<Item> allJobs) { ArrayList<Job> unstableJobs = new ArrayList<Job>(); for (Item item : allJobs) { .... } .... }
With this change I think that we avoid the error.