1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.component.annotation; |
21 |
|
|
22 |
|
import java.io.BufferedReader; |
23 |
|
import java.io.IOException; |
24 |
|
import java.io.InputStream; |
25 |
|
import java.io.InputStreamReader; |
26 |
|
import java.lang.annotation.Annotation; |
27 |
|
import java.lang.reflect.ParameterizedType; |
28 |
|
import java.lang.reflect.Type; |
29 |
|
import java.net.URL; |
30 |
|
import java.util.ArrayList; |
31 |
|
import java.util.Arrays; |
32 |
|
import java.util.Enumeration; |
33 |
|
import java.util.HashMap; |
34 |
|
import java.util.LinkedHashSet; |
35 |
|
import java.util.List; |
36 |
|
import java.util.Map; |
37 |
|
import java.util.Set; |
38 |
|
import java.util.zip.ZipEntry; |
39 |
|
import java.util.zip.ZipInputStream; |
40 |
|
|
41 |
|
import javax.inject.Provider; |
42 |
|
|
43 |
|
import org.slf4j.Logger; |
44 |
|
import org.slf4j.LoggerFactory; |
45 |
|
import org.xwiki.component.descriptor.ComponentDescriptor; |
46 |
|
import org.xwiki.component.descriptor.DefaultComponentDescriptor; |
47 |
|
import org.xwiki.component.internal.RoleHint; |
48 |
|
import org.xwiki.component.manager.ComponentManager; |
49 |
|
import org.xwiki.component.util.DefaultParameterizedType; |
50 |
|
import org.xwiki.component.util.ReflectionUtils; |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
@version |
56 |
|
@since |
57 |
|
|
|
|
| 77.1% |
Uncovered Elements: 51 (223) |
Complexity: 57 |
Complexity Density: 0.38 |
|
58 |
|
public class ComponentAnnotationLoader |
59 |
|
{ |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
public static final String COMPONENT_LIST = "META-INF/components.txt"; |
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
@deprecated@link |
71 |
|
|
72 |
|
@Deprecated |
73 |
|
public static final String COMPONENT_OVERRIDE_LIST = "META-INF/component-overrides.txt"; |
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
private static final String COMPONENT_LIST_ENCODING = "UTF-8"; |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
private static final Logger LOGGER = LoggerFactory.getLogger(ComponentAnnotationLoader.class); |
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
private ComponentDescriptorFactory factory = new ComponentDescriptorFactory(); |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
@param |
94 |
|
@param |
95 |
|
|
96 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 2 |
Complexity Density: 0.25 |
|
97 |
2476 |
public void initialize(ComponentManager manager, ClassLoader classLoader)... |
98 |
|
{ |
99 |
2476 |
try { |
100 |
|
|
101 |
2476 |
List<ComponentDeclaration> componentDeclarations = getDeclaredComponents(classLoader, COMPONENT_LIST); |
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
2476 |
List<ComponentDeclaration> componentOverrideDeclarations = |
107 |
|
getDeclaredComponents(classLoader, COMPONENT_OVERRIDE_LIST); |
108 |
2476 |
for (ComponentDeclaration componentOverrideDeclaration : componentOverrideDeclarations) { |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
3 |
componentDeclarations.remove(componentOverrideDeclaration); |
113 |
|
|
114 |
3 |
componentDeclarations.add(new ComponentDeclaration(componentOverrideDeclaration |
115 |
|
.getImplementationClassName(), 0)); |
116 |
|
} |
117 |
|
|
118 |
2476 |
initialize(manager, classLoader, componentDeclarations); |
119 |
|
} catch (Exception e) { |
120 |
|
|
121 |
|
|
122 |
0 |
throw new RuntimeException("Failed to get the list of components to load", e); |
123 |
|
} |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
|
@param |
128 |
|
@param |
129 |
|
|
130 |
|
@param |
131 |
|
@since |
132 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
133 |
3605 |
public void initialize(ComponentManager manager, ClassLoader classLoader,... |
134 |
|
List<ComponentDeclaration> componentDeclarations) |
135 |
|
{ |
136 |
3605 |
register(manager, classLoader, componentDeclarations); |
137 |
|
} |
138 |
|
|
139 |
|
|
140 |
|
@param |
141 |
|
@param |
142 |
|
|
143 |
|
@param |
144 |
|
@since |
145 |
|
|
|
|
| 86.7% |
Uncovered Elements: 2 (15) |
Complexity: 3 |
Complexity Density: 0.2 |
|
146 |
3605 |
public void register(ComponentManager manager, ClassLoader classLoader,... |
147 |
|
List<ComponentDeclaration> componentDeclarations) |
148 |
|
{ |
149 |
3605 |
try { |
150 |
|
|
151 |
|
|
152 |
3605 |
Map<RoleHint<?>, ComponentDescriptor<?>> descriptorMap = |
153 |
|
new HashMap<RoleHint<?>, ComponentDescriptor<?>>(); |
154 |
3605 |
Map<RoleHint<?>, Integer> priorityMap = new HashMap<RoleHint<?>, Integer>(); |
155 |
|
|
156 |
3605 |
for (ComponentDeclaration componentDeclaration : componentDeclarations) { |
157 |
683010 |
Class<?> componentClass; |
158 |
683010 |
try { |
159 |
683010 |
componentClass = classLoader.loadClass(componentDeclaration.getImplementationClassName()); |
160 |
|
} catch (Exception e) { |
161 |
0 |
throw new RuntimeException( |
162 |
|
String.format("Failed to load component class [%s] for annotation parsing", |
163 |
|
componentDeclaration.getImplementationClassName()), e); |
164 |
|
} |
165 |
|
|
166 |
|
|
167 |
683010 |
for (Type componentRoleType : findComponentRoleTypes(componentClass)) { |
168 |
724940 |
for (ComponentDescriptor<?> componentDescriptor : this.factory.createComponentDescriptors( |
169 |
|
componentClass, componentRoleType)) { |
170 |
|
|
171 |
|
|
172 |
739417 |
RoleHint<?> roleHint = |
173 |
|
new RoleHint(componentDescriptor.getRoleType(), componentDescriptor.getRoleHint()); |
174 |
|
|
175 |
739417 |
addComponent(descriptorMap, priorityMap, roleHint, componentDescriptor, componentDeclaration, |
176 |
|
true); |
177 |
|
} |
178 |
|
} |
179 |
|
} |
180 |
|
|
181 |
|
|
182 |
3605 |
for (ComponentDescriptor<?> descriptor : descriptorMap.values()) { |
183 |
734984 |
manager.registerComponent(descriptor); |
184 |
|
} |
185 |
|
} catch (Exception e) { |
186 |
|
|
187 |
|
|
188 |
0 |
throw new RuntimeException("Failed to dynamically load components with annotations", e); |
189 |
|
} |
190 |
|
} |
191 |
|
|
|
|
| 73.7% |
Uncovered Elements: 5 (19) |
Complexity: 5 |
Complexity Density: 0.45 |
|
192 |
739417 |
private void addComponent(Map<RoleHint<?>, ComponentDescriptor<?>> descriptorMap,... |
193 |
|
Map<RoleHint<?>, Integer> priorityMap, RoleHint<?> roleHint, ComponentDescriptor<?> componentDescriptor, |
194 |
|
ComponentDeclaration componentDeclaration, boolean warn) |
195 |
|
{ |
196 |
739417 |
if (descriptorMap.containsKey(roleHint)) { |
197 |
|
|
198 |
4433 |
int currentPriority = priorityMap.get(roleHint); |
199 |
4433 |
if (componentDeclaration.getPriority() < currentPriority) { |
200 |
|
|
201 |
2232 |
descriptorMap.put(roleHint, componentDescriptor); |
202 |
2232 |
priorityMap.put(roleHint, componentDeclaration.getPriority()); |
203 |
2201 |
} else if (componentDeclaration.getPriority() == currentPriority) { |
204 |
0 |
if (warn) { |
205 |
|
|
206 |
0 |
getLogger().warn( |
207 |
|
"Component [{}] which implements [{}] tried to overwrite component " |
208 |
|
+ "[{}]. However, no action was taken since both components have the same priority " |
209 |
|
+ "level of [{}].", |
210 |
|
new Object[] { componentDeclaration.getImplementationClassName(), roleHint, |
211 |
|
descriptorMap.get(roleHint).getImplementation().getName(), currentPriority }); |
212 |
|
} |
213 |
|
} else { |
214 |
2201 |
getLogger().debug( |
215 |
|
"Ignored component [{}] since its priority level of [{}] is lower " |
216 |
|
+ "than the currently registered component [{}] which has a priority of [{}]", |
217 |
|
new Object[] { componentDeclaration.getImplementationClassName(), |
218 |
|
componentDeclaration.getPriority(), currentPriority }); |
219 |
|
} |
220 |
|
} else { |
221 |
734984 |
descriptorMap.put(roleHint, componentDescriptor); |
222 |
734984 |
priorityMap.put(roleHint, componentDeclaration.getPriority()); |
223 |
|
} |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
|
@param |
228 |
|
@param |
229 |
|
|
230 |
|
@param |
231 |
|
@since |
232 |
|
|
|
|
| 83.3% |
Uncovered Elements: 3 (18) |
Complexity: 5 |
Complexity Density: 0.36 |
|
233 |
68 |
public void unregister(ComponentManager manager, ClassLoader classLoader,... |
234 |
|
List<ComponentDeclaration> componentDeclarations) |
235 |
|
{ |
236 |
68 |
for (ComponentDeclaration componentDeclaration : componentDeclarations) { |
237 |
86 |
Class<?> componentClass = null; |
238 |
86 |
try { |
239 |
86 |
componentClass = classLoader.loadClass(componentDeclaration.getImplementationClassName()); |
240 |
|
} catch (ClassNotFoundException e) { |
241 |
0 |
getLogger().warn("Can't find any existing component with class [{}]. Ignoring it.", |
242 |
|
componentDeclaration.getImplementationClassName()); |
243 |
|
} catch (Exception e) { |
244 |
0 |
getLogger().warn("Fail to load component implementation class [{}]. Ignoring it.", |
245 |
|
componentDeclaration.getImplementationClassName(), e); |
246 |
|
} |
247 |
|
|
248 |
86 |
if (componentClass != null) { |
249 |
86 |
for (ComponentDescriptor<?> componentDescriptor : getComponentsDescriptors(componentClass)) { |
250 |
86 |
manager.unregisterComponent(componentDescriptor); |
251 |
|
|
252 |
86 |
if (componentDescriptor.getRoleType() instanceof ParameterizedType) { |
253 |
44 |
Class roleClass = ReflectionUtils.getTypeClass(componentDescriptor.getRoleType()); |
254 |
|
|
255 |
44 |
DefaultComponentDescriptor<?> classComponentDescriptor = |
256 |
|
new DefaultComponentDescriptor(componentDescriptor); |
257 |
44 |
classComponentDescriptor.setRoleType(roleClass); |
258 |
|
|
259 |
44 |
manager.unregisterComponent(classComponentDescriptor); |
260 |
|
} |
261 |
|
} |
262 |
|
} |
263 |
|
} |
264 |
|
} |
265 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
266 |
412 |
public List<ComponentDescriptor> getComponentsDescriptors(Class<?> componentClass)... |
267 |
|
{ |
268 |
412 |
List<ComponentDescriptor> descriptors = new ArrayList<ComponentDescriptor>(); |
269 |
|
|
270 |
|
|
271 |
412 |
for (Type componentRoleType : findComponentRoleTypes(componentClass)) { |
272 |
412 |
descriptors.addAll(this.factory.createComponentDescriptors(componentClass, componentRoleType)); |
273 |
|
} |
274 |
|
|
275 |
412 |
return descriptors; |
276 |
|
} |
277 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
278 |
685250 |
public Set<Type> findComponentRoleTypes(Class<?> componentClass)... |
279 |
|
{ |
280 |
685250 |
return findComponentRoleTypes(componentClass, null); |
281 |
|
} |
282 |
|
|
|
|
| 94.7% |
Uncovered Elements: 3 (57) |
Complexity: 14 |
Complexity Density: 0.4 |
|
283 |
2716562 |
public Set<Type> findComponentRoleTypes(Class<?> componentClass, Type[] parameters)... |
284 |
|
{ |
285 |
|
|
286 |
2716562 |
Set<Type> types = new LinkedHashSet<Type>(); |
287 |
|
|
288 |
2716562 |
Component component = componentClass.getAnnotation(Component.class); |
289 |
|
|
290 |
|
|
291 |
2716562 |
if (component != null && component.roles().length > 0) { |
292 |
14250 |
types.addAll(Arrays.asList(component.roles())); |
293 |
|
} else { |
294 |
|
|
295 |
|
|
296 |
2702312 |
for (Type interfaceType : getGenericInterfaces(componentClass)) { |
297 |
1447316 |
Class<?> interfaceClass; |
298 |
1447316 |
Type[] interfaceParameters; |
299 |
|
|
300 |
1447316 |
if (interfaceType instanceof ParameterizedType) { |
301 |
181304 |
ParameterizedType interfaceParameterizedType = (ParameterizedType) interfaceType; |
302 |
|
|
303 |
181304 |
interfaceClass = ReflectionUtils.getTypeClass(interfaceType); |
304 |
181304 |
Type[] variableParameters = interfaceParameterizedType.getActualTypeArguments(); |
305 |
|
|
306 |
181304 |
interfaceParameters = |
307 |
|
ReflectionUtils.resolveSuperArguments(variableParameters, componentClass, parameters); |
308 |
|
|
309 |
181304 |
if (interfaceParameters == null) { |
310 |
669 |
interfaceType = interfaceClass; |
311 |
180635 |
} else if (interfaceParameters != variableParameters) { |
312 |
85560 |
interfaceType = |
313 |
|
new DefaultParameterizedType(interfaceParameterizedType.getOwnerType(), interfaceClass, |
314 |
|
interfaceParameters); |
315 |
|
} |
316 |
1266012 |
} else if (interfaceType instanceof Class) { |
317 |
1266012 |
interfaceClass = (Class<?>) interfaceType; |
318 |
1266012 |
interfaceParameters = null; |
319 |
|
} else { |
320 |
0 |
continue; |
321 |
|
} |
322 |
|
|
323 |
|
|
324 |
1447316 |
types.addAll(findComponentRoleTypes(interfaceClass, interfaceParameters)); |
325 |
|
|
326 |
|
|
327 |
1447316 |
if (ReflectionUtils.getDirectAnnotation(Role.class, interfaceClass) != null) { |
328 |
701589 |
types.add(interfaceType); |
329 |
|
} |
330 |
|
|
331 |
|
|
332 |
1447316 |
if (Provider.class.isAssignableFrom(interfaceClass)) { |
333 |
17151 |
types.add(interfaceType); |
334 |
|
} |
335 |
|
|
336 |
|
|
337 |
1447316 |
if (ReflectionUtils.getDirectAnnotation(ComponentRole.class, interfaceClass) != null) { |
338 |
9445 |
types.add(interfaceClass); |
339 |
|
} |
340 |
|
} |
341 |
|
|
342 |
|
|
343 |
|
|
344 |
2702312 |
Type superType = componentClass.getGenericSuperclass(); |
345 |
2702312 |
if (superType != null && superType != Object.class) { |
346 |
583996 |
if (superType instanceof ParameterizedType) { |
347 |
159726 |
ParameterizedType superParameterizedType = (ParameterizedType) superType; |
348 |
159726 |
types.addAll(findComponentRoleTypes((Class) superParameterizedType.getRawType(), ReflectionUtils |
349 |
|
.resolveSuperArguments(superParameterizedType.getActualTypeArguments(), componentClass, |
350 |
|
parameters))); |
351 |
424270 |
} else if (superType instanceof Class) { |
352 |
424270 |
types.addAll(findComponentRoleTypes((Class) superType, null)); |
353 |
|
} |
354 |
|
} |
355 |
|
} |
356 |
|
|
357 |
2716562 |
return types; |
358 |
|
} |
359 |
|
|
360 |
|
|
361 |
|
@link |
362 |
|
|
363 |
|
@param |
364 |
|
@return |
365 |
|
|
366 |
|
@throws |
367 |
|
@link |
368 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
369 |
2702312 |
private Type[] getGenericInterfaces(Class<?> componentClass)... |
370 |
|
{ |
371 |
2702312 |
Type[] interfaceTypes; |
372 |
2702312 |
try { |
373 |
2702312 |
interfaceTypes = componentClass.getGenericInterfaces(); |
374 |
|
} catch (Exception e) { |
375 |
0 |
throw new RuntimeException(String.format("Failed to get interface for [%s]", componentClass.getName()), e); |
376 |
|
} |
377 |
2702312 |
return interfaceTypes; |
378 |
|
} |
379 |
|
|
380 |
|
|
381 |
|
|
382 |
|
|
383 |
|
|
384 |
|
@link |
385 |
|
|
386 |
|
@param |
387 |
|
@return |
388 |
|
@deprecated@link |
389 |
|
|
|
|
| 0% |
Uncovered Elements: 23 (23) |
Complexity: 7 |
Complexity Density: 0.47 |
|
390 |
0 |
@Deprecated... |
391 |
|
public Set<Class<?>> findComponentRoleClasses(Class<?> componentClass) |
392 |
|
{ |
393 |
|
|
394 |
0 |
Set<Class<?>> classes = new LinkedHashSet<Class<?>>(); |
395 |
|
|
396 |
0 |
Component component = componentClass.getAnnotation(Component.class); |
397 |
0 |
if (component != null && component.roles().length > 0) { |
398 |
0 |
classes.addAll(Arrays.asList(component.roles())); |
399 |
|
} else { |
400 |
|
|
401 |
0 |
for (Class<?> interfaceClass : componentClass.getInterfaces()) { |
402 |
|
|
403 |
0 |
classes.addAll(findComponentRoleClasses(interfaceClass)); |
404 |
|
|
405 |
|
|
406 |
0 |
for (Annotation annotation : interfaceClass.getDeclaredAnnotations()) { |
407 |
0 |
if (annotation.annotationType() == ComponentRole.class) { |
408 |
0 |
classes.add(interfaceClass); |
409 |
|
} |
410 |
|
} |
411 |
|
|
412 |
|
|
413 |
0 |
if (Provider.class.isAssignableFrom(interfaceClass)) { |
414 |
0 |
classes.add(interfaceClass); |
415 |
|
} |
416 |
|
} |
417 |
|
|
418 |
|
|
419 |
|
|
420 |
0 |
Class<?> superClass = componentClass.getSuperclass(); |
421 |
0 |
if (superClass != null && superClass != Object.class) { |
422 |
0 |
classes.addAll(findComponentRoleClasses(superClass)); |
423 |
|
} |
424 |
|
} |
425 |
|
|
426 |
0 |
return classes; |
427 |
|
} |
428 |
|
|
429 |
|
|
430 |
|
|
431 |
|
|
432 |
|
@param |
433 |
|
@param |
434 |
|
@return |
435 |
|
@throws |
436 |
|
@since |
437 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 2 |
Complexity Density: 0.2 |
|
438 |
4952 |
private List<ComponentDeclaration> getDeclaredComponents(ClassLoader classLoader, String location)... |
439 |
|
throws IOException |
440 |
|
{ |
441 |
4952 |
List<ComponentDeclaration> annotatedClassNames = new ArrayList<ComponentDeclaration>(); |
442 |
4952 |
Enumeration<URL> urls = classLoader.getResources(location); |
443 |
89358 |
while (urls.hasMoreElements()) { |
444 |
84406 |
URL url = urls.nextElement(); |
445 |
|
|
446 |
84406 |
LOGGER.debug("Loading declared component definitions from [{}]", url); |
447 |
|
|
448 |
84406 |
InputStream componentListStream = url.openStream(); |
449 |
|
|
450 |
84406 |
try { |
451 |
84406 |
annotatedClassNames.addAll(getDeclaredComponents(componentListStream)); |
452 |
|
} finally { |
453 |
84406 |
componentListStream.close(); |
454 |
|
} |
455 |
|
} |
456 |
|
|
457 |
4952 |
return annotatedClassNames; |
458 |
|
} |
459 |
|
|
460 |
|
|
461 |
|
|
462 |
|
|
463 |
|
|
464 |
|
@param |
465 |
|
@return |
466 |
|
@throws |
467 |
|
@since |
468 |
|
|
|
|
| 85.7% |
Uncovered Elements: 3 (21) |
Complexity: 5 |
Complexity Density: 0.33 |
|
469 |
84604 |
public List<ComponentDeclaration> getDeclaredComponents(InputStream componentListStream) throws IOException... |
470 |
|
{ |
471 |
84604 |
List<ComponentDeclaration> annotatedClassNames = new ArrayList<ComponentDeclaration>(); |
472 |
|
|
473 |
|
|
474 |
|
|
475 |
|
|
476 |
84604 |
BufferedReader in = new BufferedReader(new InputStreamReader(componentListStream, COMPONENT_LIST_ENCODING)); |
477 |
84604 |
String inputLine; |
478 |
? |
while ((inputLine = in.readLine()) != null) { |
479 |
|
|
480 |
669983 |
if (inputLine.trim().length() > 0) { |
481 |
667801 |
try { |
482 |
667801 |
String[] chunks = inputLine.split(":"); |
483 |
667801 |
ComponentDeclaration componentDeclaration; |
484 |
667801 |
if (chunks.length > 1) { |
485 |
4530 |
componentDeclaration = new ComponentDeclaration(chunks[1], Integer.parseInt(chunks[0])); |
486 |
|
} else { |
487 |
663271 |
componentDeclaration = new ComponentDeclaration(chunks[0]); |
488 |
|
} |
489 |
667801 |
LOGGER.debug(" - Adding component definition [{}] with priority [{}]", |
490 |
|
componentDeclaration.getImplementationClassName(), componentDeclaration.getPriority()); |
491 |
667801 |
annotatedClassNames.add(componentDeclaration); |
492 |
|
} catch (Exception e) { |
493 |
0 |
getLogger().error("Failed to parse component declaration from [{}]", inputLine, e); |
494 |
|
} |
495 |
|
} |
496 |
|
} |
497 |
|
|
498 |
84604 |
return annotatedClassNames; |
499 |
|
} |
500 |
|
|
501 |
|
|
502 |
|
|
503 |
|
|
504 |
|
@param |
505 |
|
@return |
506 |
|
@throws |
507 |
|
|
|
|
| 62.5% |
Uncovered Elements: 9 (24) |
Complexity: 8 |
Complexity Density: 0.57 |
|
508 |
202 |
public List<ComponentDeclaration> getDeclaredComponentsFromJAR(InputStream jarFile) throws IOException... |
509 |
|
{ |
510 |
202 |
ZipInputStream zis = new ZipInputStream(jarFile); |
511 |
|
|
512 |
202 |
List<ComponentDeclaration> componentDeclarations = null; |
513 |
202 |
List<ComponentDeclaration> componentOverrideDeclarations = null; |
514 |
|
|
515 |
1302 |
for (ZipEntry entry = zis.getNextEntry(); entry != null |
516 |
|
&& (componentDeclarations == null || componentOverrideDeclarations == null); entry = zis.getNextEntry()) { |
517 |
1100 |
if (entry.getName().equals(ComponentAnnotationLoader.COMPONENT_LIST)) { |
518 |
198 |
componentDeclarations = getDeclaredComponents(zis); |
519 |
902 |
} else if (entry.getName().equals(ComponentAnnotationLoader.COMPONENT_OVERRIDE_LIST)) { |
520 |
0 |
componentOverrideDeclarations = getDeclaredComponents(zis); |
521 |
|
} |
522 |
|
} |
523 |
|
|
524 |
|
|
525 |
|
|
526 |
202 |
if (componentOverrideDeclarations != null) { |
527 |
0 |
if (componentDeclarations == null) { |
528 |
0 |
componentDeclarations = new ArrayList<ComponentDeclaration>(); |
529 |
|
} |
530 |
0 |
for (ComponentDeclaration componentOverrideDeclaration : componentOverrideDeclarations) { |
531 |
0 |
componentDeclarations.add(new ComponentDeclaration(componentOverrideDeclaration |
532 |
|
.getImplementationClassName(), 0)); |
533 |
|
} |
534 |
|
} |
535 |
|
|
536 |
202 |
return componentDeclarations; |
537 |
|
} |
538 |
|
|
539 |
|
|
540 |
|
|
541 |
|
|
542 |
|
|
543 |
|
@return |
544 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
545 |
2201 |
protected Logger getLogger()... |
546 |
|
{ |
547 |
2201 |
return LOGGER; |
548 |
|
} |
549 |
|
} |