SONARJAVA-384 Improve performance of Scope.lookup