1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.se.common; |
17 |
|
|
18 |
|
import java.util.ArrayList; |
19 |
|
import java.util.List; |
20 |
|
|
21 |
|
import org.qedeq.base.utility.EqualsUtility; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
@link |
26 |
|
|
27 |
|
@author |
28 |
|
|
|
|
| 99% |
Uncovered Elements: 1 (97) |
Complexity: 31 |
Complexity Density: 0.65 |
|
29 |
|
public class SourceFileExceptionList extends Exception { |
30 |
|
|
31 |
|
|
32 |
|
private final List exceptions = new ArrayList(); |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
37 |
8637
|
public SourceFileExceptionList() {... |
38 |
|
} |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
@param |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
45 |
46
|
public SourceFileExceptionList(final SourceFileException e) {... |
46 |
46
|
if (e != null) { |
47 |
45
|
add(e); |
48 |
|
} |
49 |
|
} |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
@param |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 3 |
Complexity Density: 1 |
|
56 |
1216
|
public SourceFileExceptionList(final SourceFileExceptionList e) {... |
57 |
1216
|
if (e != null) { |
58 |
8523
|
for (int i = 0; i < e.size(); i++) { |
59 |
8148
|
add(e.get(i)); |
60 |
|
} |
61 |
|
} |
62 |
|
} |
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
67 |
4
|
public void clear() {... |
68 |
4
|
exceptions.clear(); |
69 |
|
} |
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
@param |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 4 |
Complexity Density: 0.67 |
|
76 |
8714
|
public void add(final SourceFileException e) {... |
77 |
8714
|
if (e == null) { |
78 |
1
|
return; |
79 |
|
} |
80 |
8713
|
if (size() == 0) { |
81 |
557
|
initCause(e); |
82 |
|
} |
83 |
8713
|
if (!exceptions.contains(e)) { |
84 |
8651
|
exceptions.add(e); |
85 |
|
} |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
@param |
92 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 5 |
Complexity Density: 0.71 |
|
93 |
1914
|
public void add(final SourceFileExceptionList e) {... |
94 |
1914
|
if (e == null) { |
95 |
1
|
return; |
96 |
|
} |
97 |
2585
|
for (int i = 0; i < e.size(); i++) { |
98 |
672
|
if (size() == 0) { |
99 |
99
|
initCause(e.get(i)); |
100 |
|
} |
101 |
672
|
if (!exceptions.contains(e.get(i))) { |
102 |
633
|
exceptions.add(e.get(i)); |
103 |
|
} |
104 |
|
} |
105 |
|
} |
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
@return |
111 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
112 |
25470
|
public final int size() {... |
113 |
25470
|
return exceptions.size(); |
114 |
|
} |
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
@param@link |
120 |
|
@return |
121 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
122 |
10228
|
public final SourceFileException get(final int i) {... |
123 |
10228
|
return (SourceFileException) exceptions.get(i); |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
@return |
130 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
131 |
1
|
public final SourceFileException[] toArray() {... |
132 |
1
|
return (SourceFileException[]) exceptions.toArray( |
133 |
|
new SourceFileException[exceptions.size()]); |
134 |
|
} |
135 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
136 |
6
|
public int hashCode() {... |
137 |
6
|
int result = 71; |
138 |
15
|
for (int i = 0; i < size(); i++) { |
139 |
9
|
result = result ^ (get(i) != null ? get(i).hashCode() : 0); |
140 |
|
} |
141 |
6
|
return result; |
142 |
|
} |
143 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 5 |
Complexity Density: 0.56 |
|
144 |
28
|
public boolean equals(final Object object) {... |
145 |
28
|
if (!(object instanceof SourceFileExceptionList)) { |
146 |
8
|
return false; |
147 |
|
} |
148 |
20
|
SourceFileExceptionList sfl = (SourceFileExceptionList) object; |
149 |
20
|
if (size() != sfl.size()) { |
150 |
12
|
return false; |
151 |
|
} |
152 |
20
|
for (int i = 0; i < size(); i++) { |
153 |
14
|
if (!EqualsUtility.equals(get(i), sfl.get(i))) { |
154 |
2
|
return false; |
155 |
|
} |
156 |
|
} |
157 |
6
|
return true; |
158 |
|
} |
159 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
160 |
128
|
public String getMessage() {... |
161 |
128
|
final StringBuffer buffer = new StringBuffer(); |
162 |
407
|
for (int i = 0; i < size(); i++) { |
163 |
279
|
if (i != 0) { |
164 |
190
|
buffer.append("\n"); |
165 |
|
} |
166 |
279
|
final SourceFileException e = get(i); |
167 |
279
|
buffer.append(i).append(": "); |
168 |
279
|
buffer.append(e.toString()); |
169 |
|
} |
170 |
128
|
return buffer.toString(); |
171 |
|
} |
172 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
173 |
22
|
public String toString() {... |
174 |
22
|
final StringBuffer buffer = new StringBuffer(); |
175 |
22
|
buffer.append(getClass().getName()); |
176 |
22
|
buffer.append("\n"); |
177 |
22
|
buffer.append(getMessage()); |
178 |
22
|
return buffer.toString(); |
179 |
|
} |
180 |
|
|
181 |
|
} |