The existing code kept the space if it was there for identifiers, and it didn't handle this. After this patch, for java this is handled in addition to identifiers, and existing space is always stripped between identifier and ::.
Also accept :: in addition to . in front of < in foo::<T>bar generic calls.