I am working on an android launcher based on the stock launcher. I am just interested why are there lots of global variables converted to local variables in methods e.g.
final VelocityTracker velocityTracker = mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000);
instead of just
mVelocityTracker.computeCurrentVelocity(1000);
Is it some android thing or a general java rule? It makes no sense allocating a new VelocityTracker
when it can be accessed directly.
EDIT Yes this code is being repeated many times.