7 Replies Latest reply: Mar 23, 2007 9:06 AM by 807606 RSS

    ArrayList and toArray()


      I have an ArrayList:

      ArrayList<javax.mail.SearchTerm> terms = new ArrayList<javax.mail.SearchTerm>();

      I add terms to this list and then try to build an AndTerm():

      SearchTerm query = new AndTerm((SearchTerm[]) terms.toArray());

      It compiles fine but Tomcat barfs.

      Thanks in advance.