GRADLE-2962 - Don't attempt to load filtered classes.

Previously they were loaded before deciding to filter them or not.