[java/cs] Better fix for Issue #2835|