forked from typetools/checker-framework
/
NullTypeVarTest.java
32 lines (25 loc) · 921 Bytes
/
NullTypeVarTest.java
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
// A test that the interaction between type variables and null types
// is handled correctly in WPI, based on the indentString variable
// in
// https://github.com/plume-lib/bcel-util/blob/master/src/main/java/org/plumelib/bcelutil/SimpleLog.java
import java.util.List;
import java.util.ArrayList;
public class NullTypeVarTest {
// :: warning: assignment
private String indentString = null;
private List<String> indentStrings;
private final String INDENT_STR_ONE_LEVEL = " ";
public NullTypeVarTest() {
indentStrings = new ArrayList<String>();
indentStrings.add("");
}
private String getIndentString(int indentLevel) {
if (indentString == null) {
for (int i = indentStrings.size(); i <= indentLevel; i++) {
indentStrings.add(indentStrings.get(i - 1) + INDENT_STR_ONE_LEVEL);
}
indentString = indentStrings.get(indentLevel);
}
return indentString;
}
}