To some degree, I think you're talking past each other.
Andrei is saying "Never call System.exit() if the probability that the
main method might be invoked from other than the shell is nonzero", and
I think he is correct. But given the complexity of the main() method in
some FB classes, its almost impossible to expect that to be true, either
because it will be cut-and-pasted or called directly because people
can't figure out how to replicate the setup logic. The refactoring is
simple; move more of the code for configuring FB out of main, and
encapsulate the assumption of being called from the shell into the thin
main() wrapper around FB.
|