Pull loop invariant code outside of the loop

askOption calls are expensive, and there’s no need to recompute
symbol-specific parts inside the loop over methods. This will improve
performance in UI code, like completions looking for parameter names.
Merge pull request #707 from dragos/issue/performance-improvement-javamapper

Pull loop invariant code outside of the loop