{"action":"closed","issue":{"url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/749","repository_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java","labels_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/749/labels{/name}","comments_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/749/comments","events_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/749/events","html_url":"https://github.com/Grover-c13/PokeGOAPI-Java/issues/749","id":174979415,"number":749,"title":"Transfering a pokemon messes up Pokebank","user":{"login":"bbb0x","id":21297966,"avatar_url":"https://avatars.githubusercontent.com/u/21297966?v=3","gravatar_id":"","url":"https://api.github.com/users/bbb0x","html_url":"https://github.com/bbb0x","followers_url":"https://api.github.com/users/bbb0x/followers","following_url":"https://api.github.com/users/bbb0x/following{/other_user}","gists_url":"https://api.github.com/users/bbb0x/gists{/gist_id}","starred_url":"https://api.github.com/users/bbb0x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbb0x/subscriptions","organizations_url":"https://api.github.com/users/bbb0x/orgs","repos_url":"https://api.github.com/users/bbb0x/repos","events_url":"https://api.github.com/users/bbb0x/events{/privacy}","received_events_url":"https://api.github.com/users/bbb0x/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-05T01:03:14Z","updated_at":"2016-11-30T15:46:55Z","closed_at":"2016-11-30T15:46:55Z","body":"Each time when I transfer a POKéMON with pokemon.TransferPokemon(),  Pokebank.getPokemons() returns an empty list; only POKéMONs captured after the transfer will appear in it. Restarting or checking the client shows that I did NOT accidentely nuke my team. This is a critical mistake as it messes up the entire program. Even when updating the inventories before getting the pokemon list does not help.\n\nMy call order:\n\n```\n pkmn.transferPokemon();\n bot.GetInventories().updateInventories();\n bot.GetInventories().getPokebank().getPokemons()\n```\n\nEDIT: Looking at the source; transferPokemon calls Pokebanks RemovePokemon:\n\n```\npublic void removePokemon(final Pokemon pokemon) {\n        pokemons.clear();\n        pokemons.addAll(Stream.of(pokemons).filter(new Predicate<Pokemon>() {\n            @Override\n            public boolean test(Pokemon pokemn) {\n                return pokemn.getId() != pokemon.getId();\n            }\n        }).collect(Collectors.<Pokemon>toList()));\n    }\n```\n\nSince pokemons.clear is the first line, doesn't that mean that an empty list is added on it?\nDoesn't the list needs to get copied into another one, then clear the current pokemon list and add the copied one with the filters?\n"}}
{"actor":{"display_login":"gegy1000"}}