OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 177
Line 415... Line 415...
415
    public static <E> List<E> castList(final List<?> list, Class<E> c) throws ClassCastException {
415
    public static <E> List<E> castList(final List<?> list, Class<E> c) throws ClassCastException {
416
        if (list == null) {
416
        if (list == null) {
417
            return null;
417
            return null;
418
        }
418
        }
419
 
419
 
-
 
420
        final int size = list.size();
420
        final List<E> result = new ArrayList<E>();
421
        final List<E> result = new ArrayList<E>(size);
421
        for (int i = 0; i < list.size(); i++) {
422
        for (int i = 0; i < list.size(); i++) {
422
            result.add(c.cast(list.get(i)));
423
            result.add(c.cast(list.get(i)));
423
        }
424
        }
424
        return result;
425
        return result;
425
    }
426
    }