File: KeyForPropagation.java

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,104 kB
  • sloc: java: 145,916; xml: 839; sh: 518; makefile: 404; perl: 26
file content (35 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (3)
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
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.checkerframework.checker.nullness.qual.*;

// interface Dest<DA,DB,DC,DD,DE> {
// }
//
// interface Inter1<I1A,I1B,I1C,I1D,I1E> extends Dest<I1A, I1A, I1C, I1D, String> {}
//
// interface Inter2<I2A,I2B,I2C,I2D,I2E> extends Dest<I2D,I2E,I2C,I2D,I2E> {}
//
// class Source<SA,SB,SC,SD,SE> extends HashMap<SA,SB> implements Inter2<SA,SB,SB,SD,SE> {}

class KeyForPropagation {

    {
        List<@KeyFor("a") String> a = new ArrayList<String>();
    }

    static {
        List<@KeyFor("b") String> b = new ArrayList<String>();
    }

    List<@KeyFor("c") String> c = new ArrayList<String>();

    void method() {
        List<@KeyFor("d") String> d = new ArrayList<String>();
    }

    void method(Map<String, String> v) {
        Set<String> ks = v.keySet();
    }
}