[FIXED JENKINS-18771]

... with a test case. The fix is in Stapler.
this needs to happen at least after the rowset name/nameRef fixup happens.

Since I don't think any other scripts depend on this one, I'm just giving it a low enough priority.