Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. class Depot
  2. {
  3. }
  4.  
  5. private final HashMap<Integer, Depot> depots;
  6. depots = new HashMap<>();
  7.  
  8. public Depot[] getDepots()
  9. {
  10. if (depots.values().isEmpty())
  11. {
  12. return (Depot[]) new Object[0]; ***
  13. }
  14. else
  15. {
  16. return depots.values().toArray(new Depot[depots.values().size()-1]);
  17. }
  18. }
  19.  
  20. public Depot[] getDepots()
  21. {
  22. if (depots.isEmpty())
  23. {
  24. return new Depot[0];
  25. }
  26. else
  27. {
  28. return depots.values().toArray(new Depot[depots.size()]);
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement