1 Reply Latest reply on Nov 14, 2004 11:25 AM by Johan Borchers

    CMR Collection to ArrayList

    Jonathan Rajotte Newbie

      Why can't I cast a CMR Collection into an ArrayList?


      private CompanyDetail copyCompanyToDetail(CompanyDetailLocal userLocal) {
       CompanyDetail detail = null;
       try {
       detail = new CompanyDetail();
       detail.setId(userLocal.getId());
       detail.setName(userLocal.getName());
       detail.setUsers((ArrayList)userLocal.getUsers());
       } catch (Exception e) {
       Logger.info("ERROR");
       e.printStackTrace();
       }
       return detail;
       }


      The error is:

      16:03:27,843 INFO [STDOUT] java.lang.ClassCastException
      16:03:27,843 INFO [STDOUT] at com.incycle.platform.entity.company.Company.copyCompanyToDetail(Company.java:84)

      Thanks