Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. @Benchmark
  2. public void throwException() throws IllegalArgumentException
  3. {
  4. throw new IllegalArgumentException("Hard-coded exception");
  5. }
  6.  
  7. # Run progress: 0.00% complete, ETA 00:02:00
  8. # Fork: 1 of 3
  9. # Warmup Iteration 1: <failure>
  10.  
  11. java.lang.IllegalArgumentException: Hard-coded exception
  12. [...]
  13.  
  14. @Benchmark
  15. public void throwException(Blackhole bh)
  16. {
  17. try
  18. {
  19. throw new IllegalArgumentException("Hard-coded exception");
  20. }
  21. catch (IllegalArgumentException e)
  22. {
  23. bh.consume(e);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement