Detect use of legacy APIs which modern Java versions supersede