Fixed accidental use of Java 8 getParameterCount(), plus polishing of related classes

Issue: SPR-11245