Re:New IDE: code bubbles
by guelo on Wednesday March 10, 2010 @08:55PM
(#1182587)
That's not the same since you are executing the bar method multiple times.
[ Parent
| on HN ]
If you really want to get picky,
return foo.bar().baz().qux() * 2;
Could become:
Bar bar = foo.bar();
if(bar == null) handleBarNull();
else {
Baz baz = bar.baz();
if(baz == null) handleBazNull();
else {
//(assuming qux is a value)
return baz.qux() * 2;
}
}