Attempt to solve Bug #2795. review @dinhviethoa

review @dinhviethoa 
I think you copy-pasted the code of this method from the method getProjectLocation().
Could you reuse this function in getProjectLocation()?
It would avoid a code duplication.