Issue Type: Bug Bug
Affects Versions: current
Assignee: Peter Hayes
Components: dashboard-view
Created: 18/Jul/14 3:33 PM
Description:

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.

Environment: Jenkins: 1.572
SO: Ubuntu 12.04 LTS
Project: Jenkins
Priority: Major Major
Reporter: Raj vasikarla
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to