dungeonqueer Posted September 29, 2017 Posted September 29, 2017 When using this code: getObjects().closest(Entity::exists, obj -> objList.contains(obj)); I'm met with: Quote Unchecked generics array creation for varargs parameter Is this incorrect use of the EntityApi's #closest method usage? It accepts a varargs parameter of Filter<RS2Object>.
Apaec Posted September 29, 2017 Posted September 29, 2017 Your code is OK, I think this is a problem with the ambiguity that generics cause with the compiler.
dungeonqueer Posted September 29, 2017 Author Posted September 29, 2017 1 minute ago, Apaec said: Your code is OK, I think this is a problem with the ambiguity that generics cause with the compiler. What would be an alternative that wouldn't cause ambiguity?
Explv Posted September 29, 2017 Posted September 29, 2017 2 hours ago, dungeonqueer said: What would be an alternative that wouldn't cause ambiguity? You will find these warnings frequently with the OSBot API, just ignore them.
Apaec Posted September 29, 2017 Posted September 29, 2017 14 hours ago, dungeonqueer said: What would be an alternative that wouldn't cause ambiguity? Not that I can think of. Unfortunately you will either have to ignore or suppress it!