title: Type safety: The expression of type Map[] needs unchecked conversion to conform to Map<String,Object>[]
body: <p>I have the following two lines:</p>
  
  <pre><code>Map&lt;String,Object&gt;[] IEXDivMap = null;       
  
  IEXDivMap =  new Map[IEXJsonArray.length()];
  </code></pre>
  
  <p>and get the warning:</p>
  
  <pre><code>The expression of type Map[] needs unchecked conversion to conform to Map&lt;String,Object&gt;[]
  </code></pre>
  
  <p>Is there a way to fix that?</p>
  
  <p>UPDATE:</p>
  
  <p>I was asked in the comments why we need a Map array to begin with.  We are getting a series of hashmaps and placing each one inside the map array.  Here's the code:</p>
  
  <pre><code>@SuppressWarnings("unchecked")
  public static Map&lt;String,Object&gt;[] getDiv(String ticker) {
      Map&lt;String,Object&gt;[] IEXDivMap = null;
      try{
          String url = "https://api.IEXtrading.com/1.0/stock/" + ticker + "/dividends/1y"; 
          URL obj = new URL(url);   
  
          HttpURLConnection con = (HttpURLConnection) obj.openConnection();       
          con.setRequestMethod("GET");
          int responseCode = con.getResponseCode();
          if(responseCode == 404){
              System.out.println("Ticker " + ticker + " NOT FOUND in getDiv()!");
              return IEXDivMap;                
          }else if (responseCode != 200){
              System.out.println("IEX Printing All Response Header for URL: " + obj.toString() + "\n");
              Map&lt;String, List&lt;String&gt;&gt; map = con.getHeaderFields();            
              for(Map.Entry&lt;String, List&lt;String&gt;&gt; entry : map.entrySet()) {
                  System.out.println("IEX " + entry.getKey() + " : " + entry.getValue());
              }
          }
  
          BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
          String inputLine;
          StringBuilder response = new StringBuilder();
  
          while ((inputLine = in.readLine()) != null) {
              response.append(inputLine);             
          }
          in.close();
  
          JSONArray IEXJsonArray = new JSONArray(response.toString());        
          IEXDivMap = new Map[IEXJsonArray.length()];
  
          for (int i = 0; i &lt; IEXJsonArray.length(); i++) {
              IEXDivMap[i] = new HashMap&lt;String,Object&gt;();
              JSONObject IEXJsonObject = IEXJsonArray.getJSONObject(i);
  
              IEXDivMap[i].put("exDate",IEXJsonObject.getString("exDate"));
              IEXDivMap[i].put("amount",IEXJsonObject.getString("amount"));
  
              //System.out.println(IEXDivMap[i]);
              System.out.println(IEXDivMap[i].get("exDate") + " 0  " + IEXDivMap[i].get("amount"));
          }
      }catch(Exception e){
          System.out.println("FATAL ERROR: Something went wrong in getDiv " + e.getMessage());
          System.exit(0);
      }
      return IEXDivMap; 
  }
  </code></pre>