Project

General

Profile

Download (972 Bytes) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2016 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.cdm.hibernate;
11

    
12
import java.util.Collection;
13

    
14
/**
15
 * Helper class to remove null values from collections which are left over artifacts due to
16
 * https://hibernate.atlassian.net/browse/HHH-9751
17
 *
18
 * @author a.kohlbecker
19
 * @date Jun 13, 2016
20
 *
21
 */
22
public class HHH_9751_Util {
23

    
24
    /**
25
     *
26
     * @param collection
27
     * @return the number of null values removed from the collection
28
     */
29
    static public int removeAllNull(Collection collection) {
30
        int cnt = 0;
31
        if (collection.contains(null)){
32
            while(collection.contains(null)){
33
                cnt++;
34
                collection.remove(null);
35
            }
36
        }
37
        return cnt;
38
    }
39

    
40
}
(4-4/11)