title: Type safety: The expression of type ArrayList[] needs unchecked conversion
body: <p>I am working on a project in which I am getting TypeSafety issues on initializing one method with a particular size. In my run method, I have yellow line on the <code>new ArrayList[tableLists.size()]</code> and complaining about-</p>
  
  <p><code>Type safety: The expression of type ArrayList[] needs unchecked conversion to conform to ArrayList&lt;Method&gt;[]</code></p>
  
  <p>Below is the code.</p>
  
  <pre><code>private ArrayList&lt;Method&gt; methods[] = null;
  
  
      @Override
      public void run() {
  
          methods = new ArrayList[tableLists.size()];
  
  
      }
  </code></pre>
  
  <p>How can I fix this <code>TypeSafety</code> issue here?</p>
  
  <p><strong>Updated:-</strong></p>
  
  <pre><code>    int j = 0;
      dbConnection = new Connection[tableLists.size()];
      callableStatement = new CallableStatement[tableLists.size()];
      methods = new ArrayList[tableLists.size()];
  
      //loop around the map values and make the connection list
      for (Map&lt;String, String&gt; map : tableLists.values()) {
  
          dbConnection[j] = getDBConnection(map.get("URL"), map.get("USER"), map.get("PASSWORD"), map.get("DRIVER"));
          callableStatement[j] = dbConnection[j].prepareCall(map.get("SQL"));
  
          methods[j] = getRequiredMethods(map.get("SUFFIX"));
          j++;
      }
  </code></pre>