1

I have used JSON library from external provider (google code project) which have a class JSONArray defined this way:

public class JSONArray extends ArrayList implements List , ... {

So it has a Collection's method .addAll( Collection<? extends E> elements ) but of course, simple usage:

JSONArray someData = new JSONArray();
someData.addAll( Arrays.asList( new String[] {"a","b"} ) );

rises unchecked warning, same with explicit call to Arrays.<String>asList.

Is there a way to remove this warning without marking whole method with @SuppressWarnings or extract this operation to another method with @SuppressWarnings?

Piotr Müller
  • 5,323
  • 5
  • 55
  • 82
  • 1
    Hmmm, running that code, using wink-json4j 1.3.0, I get no warnings. What library are you specificly using? I could not find any other JSONArray that would match the signature.. – Zavior Jun 08 '13 at 11:50

0 Answers0