Make MoreFutures.isSuccess not throw when it is interrupted.

Summary:
It's possible for a future (like Guava's AbstractFuture) to return true
from isDone but still throw an InterruptedException from get() if the
current thread has been interrupted.  The old code threw a
RuntimeException in this case, which was unnecessary.  Change it to just
retry and reset the thread interrupt status instead.

This solution was informed by the "Noncancelable tasks" section of
http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html

Test Plan:
Unit tests.  The new test failed 5 out of 5 times on the old code on my
machine, but it could pass spuriously (without the doNotOptimizeMe loop,
it was passing about 50% of the time).  With the new code, it should
pass deterministically.
2 files changed
tree: 6cf40e1cbb0de3b8ff79995372b9ad9e4d0a187c
  1. .idea/
  2. bin/
  3. config/
  4. docs/
  5. lib/
  6. plugin/
  7. pmd/
  8. scripts/
  9. src/
  10. test/
  11. testdata/
  12. third-party/
  13. .buckconfig
  14. .classpath
  15. .gitignore
  16. .project
  17. buck.iml
  18. build.xml
  19. DEFS
  20. LICENSE
  21. README.md
README.md

Buck

Buck is an Android build tool. To see what Buck can do for you, check out the documentation at http://facebook.github.io/buck/.

Installation

To build Buck, run the following:

git clone git@github.com:facebook/buck.git
cd buck
ant
./bin/buck --help

License

Apache License 2.0