Assigning instance field inside method
Is there any problem to do that, or exists there any surer way to do that?


Yes, it's completely broken as in setupCamera you're assigning local variables and the fields remain untouched. There are no var parameters in Java. You'd actually need something allowing to return both camera and viewport. This is doable somehow, but too verbose for the little code you're trying to minimize.