Fix NetBeans Java Hints and remove unused code