-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathUser.java
More file actions
45 lines (34 loc) · 981 Bytes
/
User.java
File metadata and controls
45 lines (34 loc) · 981 Bytes
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
import java.util.Map;
public class User {
public static void test1(ExposesRep er) {
er.getStrings()[0] = "Hello world";
}
public static void test2(ExposesRep er) {
er.getStringMap().put("Hello", "world");
}
public String[] indirectGetStrings(ExposesRep er) {
return er.getStrings();
}
public void test3(ExposesRep er) {
indirectGetStrings(er)[0] = "Hello world";
}
public static void test4(ExposesRep er, String[] ss) {
er.setStrings(ss);
ss[0] = "Hello world";
}
public static void test5(ExposesRep er, Map<String, String> m) {
er.setStringMap(m);
m.put("Hello", "world");
}
public static void test6(GenericExposesRep<String> ger) {
ger.getArray()[0] = "Hello world";
}
}
class GenericUser<T> {
public String[] indirectGetStrings(ExposesRep er) {
return er.getStrings();
}
public static void test1(ExposesRep er, GenericUser<String> gu) {
gu.indirectGetStrings(er)[0] = "Hello world";
}
}