Clover Coverage Report - Atlassian Core
Coverage timestamp: Sun Nov 30 2008 18:33:35 CST
18   75   10   6
12   51   0.56   3
3     3.33  
1    
 
 
  FilterUtils       Line # 17 18 10 0% 0.0
 
No Tests
 
1    /*
2    * Created by IntelliJ IDEA.
3    * User: mike
4    * Date: Jan 7, 2002
5    * Time: 4:32:26 AM
6    * To change template for new class use
7    * Code Style | Class Templates options (Tools | IDE Options).
8    */
9    package com.atlassian.core.util;
10   
11    import com.opensymphony.util.TextUtils;
12   
13    import java.util.ArrayList;
14    import java.util.Iterator;
15    import java.util.List;
16   
 
17    public class FilterUtils
18    {
19    /**
20    * Returned string is non-null IFF there is a true value (ie some text)
21    */
 
22  0 toggle public static String verifyString(String s)
23    {
24  0 if (TextUtils.stringSet(TextUtils.noNull(s).trim()))
25    {
26  0 return s;
27    }
28    else
29    {
30  0 return null;
31    }
32    }
33   
34    /**
35    * Retirned string array is non-null IFF there is a true value (ie some text)
36    */
 
37  0 toggle public static String[] verifyStringArray(String[] sa)
38    {
39  0 List result = new ArrayList();
40   
41  0 for (int i = 0; i < sa.length; i++)
42    {
43  0 String s = verifyString(sa[i]);
44  0 if (s != null)
45  0 result.add(s);
46    }
47   
48  0 if (result.size() == 0)
49    {
50  0 return null;
51    }
52    else
53    {
54  0 String[] resultSa = new String[result.size()];
55  0 int count = 0;
56  0 for (Iterator iterator = result.iterator(); iterator.hasNext();)
57    {
58  0 resultSa[count++] = (String) iterator.next();
59    }
60   
61  0 return resultSa;
62    }
63    }
64   
 
65  0 toggle public static Long verifyLong(Long id)
66    {
67  0 if (id != null && id.longValue() > 0)
68    {
69  0 return id;
70    }
71   
72  0 return null;
73    }
74   
75    }