[java] Filter out methods that clash with fields that were declared in a superclass. Closes #2220