jenkinsci/jenkins — pull request #463 by lvotypko (2012-05-03 08:24:56+00:00)
Title: Correction of returned url

Jelly file hudson.matrix.MatrixBuild.ajaxMatrix.jelly has wrong url for matrix run.
If a job is runnig and a user click on the build, the page of MatrixBuild contains configurations which has an image like a link to the run. This link is wrong, but return page for right object.
For example we have matrix job with name Matrix and option "run sequentially", and we ran 5. build. We click on the link to 5. build and see configurations with names a,b,c,d and the configuration a is running. We click on the configuration b and see the url is /job/Matrix/5/label=b, but there can not be run 5 for configuration b (because does not exist), there is run 4 for configuration label=b, it is misleading. And another problem is that method getDynamic() return for run url run which does not belong to this build.
So I add condition to method getDynamic() and create method getNearestRunUrl() which return right url.