Fix java7 again

Because perpetually failing tests are the gifts which keep on giving, especially when trying to perform backports, backport the instrumentation fixes so partest can pass.