Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. private void doStuff(Long inLong) {
  2. long theNumber = inLong;
  3.  
  4. /* ... */
  5. }
  6.  
  7. private void doStuff(Long inLong) {
  8. assert inLong != null;
  9. long theNumber = inLong;
  10. /* ... */
  11. }
  12.  
  13. public void doStuff(Long inLong) {
  14. if (inLong == null) { throw new IllegalArgumentException(); }
  15. long theNumber = inLong;
  16. /* ... */
  17. }
  18.  
  19. private void doStuff(Long inLong) {
  20. if (inLong == null) {
  21. handleUndef();
  22. } else {
  23. long theNumber = inLong;
  24. /* ... */
  25. }
  26. }
  27.  
  28. theNumber = 0; // or Long.MIN_VALUE or Long.MAX_VALUE or whatever you prefer
  29. if (inLong != null) {
  30. theNumber = inLong;
  31. }
  32. // ...
  33.  
  34. long theNumber = inLong;
  35.  
  36. long theNumber = inLong.longValue();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement