Correctly handle NullaryMethodTypes in the java type mapper

Fixed #1001734. No test since I cannot reproduce this reliably.