Java Parser: Fixes issue #374 with OS $1 replacement

This fixes the issue #374 within the java parser.