1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.extension.script.internal.safe; |
21 |
|
|
22 |
|
import java.util.ArrayList; |
23 |
|
import java.util.Collection; |
24 |
|
import java.util.Collections; |
25 |
|
|
26 |
|
import org.xwiki.extension.job.plan.ExtensionPlan; |
27 |
|
import org.xwiki.extension.job.plan.ExtensionPlanAction; |
28 |
|
import org.xwiki.extension.job.plan.ExtensionPlanTree; |
29 |
|
import org.xwiki.job.internal.script.safe.SafeJobStatus; |
30 |
|
import org.xwiki.script.internal.safe.ScriptSafeProvider; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
@param |
36 |
|
@version |
37 |
|
@since |
38 |
|
|
|
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 6 |
Complexity Density: 0.5 |
|
39 |
|
public class SafeExtensionPlan<J extends ExtensionPlan> extends SafeJobStatus<J> implements ExtensionPlan |
40 |
|
{ |
41 |
|
|
42 |
|
@see |
43 |
|
|
44 |
|
private Collection<ExtensionPlanAction> wrappedActions; |
45 |
|
|
46 |
|
|
47 |
|
@param |
48 |
|
@param |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
0 |
public SafeExtensionPlan(J plan, ScriptSafeProvider<?> safeProvider)... |
51 |
|
{ |
52 |
0 |
super(plan, safeProvider); |
53 |
|
} |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
55 |
0 |
@Override... |
56 |
|
public ExtensionPlanTree getTree() |
57 |
|
{ |
58 |
0 |
try { |
59 |
0 |
return new SafeExtensionPlanTree(getWrapped().getTree(), this.safeProvider); |
60 |
|
} catch (Exception e) { |
61 |
|
|
62 |
0 |
return null; |
63 |
|
} |
64 |
|
} |
65 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
66 |
0 |
@Override... |
67 |
|
public Collection<ExtensionPlanAction> getActions() |
68 |
|
{ |
69 |
0 |
if (this.wrappedActions == null) { |
70 |
0 |
Collection<ExtensionPlanAction> actions = getWrapped().getActions(); |
71 |
0 |
if (actions.isEmpty()) { |
72 |
0 |
this.wrappedActions = Collections.emptyList(); |
73 |
|
} else { |
74 |
0 |
this.wrappedActions = new ArrayList<ExtensionPlanAction>(actions.size()); |
75 |
0 |
for (ExtensionPlanAction action : actions) { |
76 |
0 |
this.wrappedActions.add(new SafeExtensionPlanAction(action, this.safeProvider)); |
77 |
|
} |
78 |
|
} |
79 |
|
} |
80 |
|
|
81 |
0 |
return this.wrappedActions; |
82 |
|
} |
83 |
|
} |