diff --git a/core/src/main/java/hudson/widgets/HistoryWidget.java b/core/src/main/java/hudson/widgets/HistoryWidget.java index 857df6ca888f9c7274d3ee8a27797485fe89a9e1..a2ec051839581c236dd5a277984713ae21f5a8c2 100644 --- a/core/src/main/java/hudson/widgets/HistoryWidget.java +++ b/core/src/main/java/hudson/widgets/HistoryWidget.java @@ -134,8 +134,10 @@ public class HistoryWidget extends Widget { trimmed = itr.hasNext(); // if we don't have enough items in the base list, setting this to false will optimize the next getRenderList() invocation. return updateFirstTransientBuildKey(lst); } - } else + } else { + // to prevent baseList's concrete type from getting picked up by in view return updateFirstTransientBuildKey(Iterators.wrap(baseList)); + } } public boolean isTrimmed() { diff --git a/test/src/test/groovy/hudson/widgets/HistoryWidgetTest.groovy b/test/src/test/groovy/hudson/widgets/HistoryWidgetTest.groovy new file mode 100644 index 0000000000000000000000000000000000000000..6493c6cec24e61e76f482e055d4811c9125b74df --- /dev/null +++ b/test/src/test/groovy/hudson/widgets/HistoryWidgetTest.groovy @@ -0,0 +1,23 @@ +package hudson.widgets + +import org.jvnet.hudson.test.HudsonTestCase +import org.jvnet.hudson.test.Bug + +/** + * + * + * @author Kohsuke Kawaguchi + */ +class HistoryWidgetTest extends HudsonTestCase { + @Bug(15499) + void testMoreLink() { + def p = createFreeStyleProject(); + for (x in 1..3) { + assertBuildStatusSuccess(p.scheduleBuild2(0)) + } + + def wc = createWebClient() + wc.javaScriptEnabled = false + wc.goTo("job/${p.name}/buildHistory/all"); + } +}