cleanup: remove code only needed for old Java versions