blob: 6fee1ae6fb2a4fa26c8ca6b8961330a53350e986 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
class ValLub {
ValLub() {
super();
}
public void easyLub() {
java.util.Map<String, Number> m = java.util.Collections.emptyMap();
final @lombok.val java.util.Map<java.lang.String, java.lang.Number> foo = ((System.currentTimeMillis() > 0) ? m : java.util.Collections.<String, Number>emptyMap());
}
public void sillyLubWithUnboxingThatProducesErrorThatVarIsPrimitive() {
Integer i = 20;
Double d = 20.0;
final @lombok.val double thisShouldBePrimitiveDouble = ((System.currentTimeMillis() > 0) ? i : d);
}
public void hardLub() {
java.util.List<String> list = new java.util.ArrayList<String>();
java.util.Set<String> set = new java.util.HashSet<String>();
final @lombok.val java.util.Collection<java.lang.String> thisShouldBeCollection = ((System.currentTimeMillis() > 0) ? list : set);
thisShouldBeCollection.add("");
String foo = thisShouldBeCollection.iterator().next();
}
}
|