In general only make these changes if it improves the
readability/maintainability of the code.
e.g. removing dead/unnecessary code gives less to maintain
in future.
Removing temps doesn't change the semantics of the code
so it doesn't really change anything.
In some cases, temps are more optimal.
e.g. code that doesn't use a temp that should:
| doSomething(getSomethingLotsOfWork());
| doSomethingElse(getSomethingLotsOfWork());
|
Also temps are useful for tracking down NPEs.
| object.getSomething().getSomethingElse();
|
should be
| temp = object.getSomething();
| temp.getSomethingElse();
|
So you know which part was null when you've only got the line number.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975464#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...