1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.ui.client.logging; |
17 |
|
|
18 |
|
import java.io.Serializable; |
19 |
|
import java.util.ArrayList; |
20 |
|
import java.util.List; |
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
25 |
|
public class LogBuffer implements Serializable { |
26 |
|
private static final long serialVersionUID = 1L; |
27 |
|
|
28 |
|
int maxSize = Integer.MAX_VALUE; |
29 |
|
List<LogMessage> buffer = new ArrayList<LogMessage>(); |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
34 |
0
|
public LogBuffer() {... |
35 |
|
|
36 |
|
} |
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
@param |
42 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
43 |
0
|
public LogBuffer(int maxSize) {... |
44 |
0
|
this.maxSize = maxSize; |
45 |
|
} |
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
@param |
50 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
51 |
0
|
public void add(LogMessage message) {... |
52 |
0
|
buffer.add(message); |
53 |
0
|
checkLimit(); |
54 |
|
} |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
@return |
59 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
60 |
0
|
public List<LogMessage> getLogMessages() {... |
61 |
0
|
return buffer; |
62 |
|
} |
63 |
|
|
64 |
|
|
65 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
66 |
0
|
private void checkLimit() {... |
67 |
0
|
while (buffer.size() > maxSize) { |
68 |
0
|
buffer.remove(0); |
69 |
|
} |
70 |
|
} |
71 |
|
} |