Fixed buggy logic in identifying Java app IDs if they contained unsuppor...

...ted characters. 

Do not merge. In regression testing.