aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/test4/JIRA152.java
blob: 8fba32a1d20514279bfbf1e480e38c9701d3a48d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package test4;

import java.util.Map;
import java.util.HashMap;

public class JIRA152 {
    public int foo(int i) { return i; }
    public int bar(int j) { return j; }
    public int tested(int k) {
        String[] p;
        if (k > 0)
            p = new String[1];
        else
            p = null;

        if (p != null)
            while (k < p.length)
                k++;

        return 0;
    }

    public String put(String s, Object obj) {
        return s;
    }

    private static Map<String, String[]> buildColumnOverride(JIRA152 element, String path) {
        Map<String, String[]> columnOverride = new HashMap<String, String[]>();
        if ( element == null ) return null;
        String singleOverride = element.toString();
        String multipleOverrides = element.toString();
        String[] overrides;
        if ( singleOverride != null ) {
            overrides = new String[] { singleOverride };
        }
        /*else if ( multipleOverrides != null ) {
            // overrides = columnOverride.get("foo");
            overrides = null;
        }*/
        else {
            overrides = null;
        }

        if ( overrides != null ) {
            for (String depAttr : overrides) {
                columnOverride.put(
                        element.put(path, depAttr.getClass()),
                        new String[] { depAttr.toLowerCase() }
                );
                //columnOverride.put("a", new String[1]);
            }
        }
        return columnOverride;
    }

    public int test() {
        Map<String,String[]> map = buildColumnOverride(this, "foo");
        return map.size();
    }
}