+1, branch-2 patch looks good to me. The javac warning is unrelated as are the unit tests, and the tests pass on branch-2 for me with the patch applied.
I believe the simplest path forward is to commit this patch to trunk, branch-2, branch-2.8 and branch-2.8.0 then update HADOOP-13866 accordingly. We do not want to ship a 4.x beta even on trunk.
Uploading essentially the same patch (except for line number offsets) for trunk, and I'll commit this pending that Jenkins run.