| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.rice.kew.exception; |
| 17 |
|
|
| 18 |
|
import java.io.Serializable; |
| 19 |
|
import java.util.ArrayList; |
| 20 |
|
import java.util.Collection; |
| 21 |
|
import java.util.Iterator; |
| 22 |
|
import java.util.List; |
| 23 |
|
|
| 24 |
|
import org.kuali.rice.kns.util.MessageMap; |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
@author |
| 36 |
|
|
|
|
|
| 0% |
Uncovered Elements: 71 (71) |
Complexity: 22 |
Complexity Density: 0.5 |
|
| 37 |
|
public class WorkflowServiceErrorImpl implements Serializable, WorkflowServiceError { |
| 38 |
|
|
| 39 |
|
private static final String CHILDREN_IN_ERROR = "-1"; |
| 40 |
|
|
| 41 |
|
static final long serialVersionUID = 6900090941686297017L; |
| 42 |
|
private Collection children; |
| 43 |
|
private String type; |
| 44 |
|
private String message; |
| 45 |
|
private String arg1; |
| 46 |
|
private String arg2; |
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
private MessageMap messageMap; |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 55 |
0
|
private WorkflowServiceErrorImpl() {... |
| 56 |
|
} |
| 57 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 58 |
0
|
public WorkflowServiceErrorImpl(String message, String type) {... |
| 59 |
0
|
children = new ArrayList(); |
| 60 |
0
|
this.message = message; |
| 61 |
0
|
this.type = type; |
| 62 |
|
} |
| 63 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 64 |
0
|
public WorkflowServiceErrorImpl(String message, String type, String arg1) {... |
| 65 |
0
|
children = new ArrayList(); |
| 66 |
0
|
this.message = message; |
| 67 |
0
|
this.type = type; |
| 68 |
0
|
this.arg1 = arg1; |
| 69 |
|
} |
| 70 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
| 71 |
0
|
public WorkflowServiceErrorImpl(String message, String type, String arg1, String arg2) {... |
| 72 |
0
|
children = new ArrayList(); |
| 73 |
0
|
this.message = message; |
| 74 |
0
|
this.type = type; |
| 75 |
0
|
this.arg1 = arg1; |
| 76 |
0
|
this.arg2 = arg2; |
| 77 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
| 78 |
0
|
public WorkflowServiceErrorImpl(String message, String type, String arg1, String arg2, MessageMap messageMap) {... |
| 79 |
0
|
children = new ArrayList(); |
| 80 |
0
|
this.message = message; |
| 81 |
0
|
this.type = type; |
| 82 |
0
|
this.arg1 = arg1; |
| 83 |
0
|
this.arg2 = arg2; |
| 84 |
0
|
this.messageMap = messageMap; |
| 85 |
|
} |
| 86 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 87 |
0
|
public Collection getChildren() {... |
| 88 |
0
|
return this.children; |
| 89 |
|
} |
| 90 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 91 |
0
|
public String getMessage() {... |
| 92 |
0
|
return this.message; |
| 93 |
|
} |
| 94 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 95 |
0
|
public String getKey() {... |
| 96 |
0
|
return this.type; |
| 97 |
|
} |
| 98 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 99 |
0
|
public String getArg1() {... |
| 100 |
0
|
return arg1; |
| 101 |
|
} |
| 102 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 103 |
0
|
public String getArg2() {... |
| 104 |
0
|
return arg2; |
| 105 |
|
} |
| 106 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 107 |
0
|
public void addChild(WorkflowServiceError busError) {... |
| 108 |
0
|
if (busError != null) { |
| 109 |
0
|
children.add(busError); |
| 110 |
|
} |
| 111 |
|
} |
| 112 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 113 |
0
|
public void addChildren(Collection children) {... |
| 114 |
0
|
this.children.addAll(children); |
| 115 |
|
} |
| 116 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 117 |
0
|
public Collection getFlatChildrenList() {... |
| 118 |
0
|
return buildFlatChildrenList(this, null); |
| 119 |
|
} |
| 120 |
|
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 4 |
Complexity Density: 0.44 |
|
| 121 |
0
|
private static Collection buildFlatChildrenList(WorkflowServiceError error, List flatList) {... |
| 122 |
0
|
if (flatList == null) { |
| 123 |
0
|
flatList = new ArrayList(); |
| 124 |
|
} |
| 125 |
|
|
| 126 |
0
|
if (error.getKey() != CHILDREN_IN_ERROR) { |
| 127 |
0
|
flatList.add(error); |
| 128 |
|
} |
| 129 |
|
|
| 130 |
0
|
Iterator iter = error.getChildren().iterator(); |
| 131 |
|
|
| 132 |
0
|
while (iter.hasNext()) { |
| 133 |
0
|
WorkflowServiceError childError = (WorkflowServiceError) iter.next(); |
| 134 |
0
|
buildFlatChildrenList(childError, flatList); |
| 135 |
|
} |
| 136 |
|
|
| 137 |
0
|
return flatList; |
| 138 |
|
} |
| 139 |
|
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
| 140 |
0
|
public String toString() {... |
| 141 |
0
|
String s = "[WorkflowServiceErrorImpl: type=" + type + ", message=" + message + ", arg1=" + arg1 + ", arg2=" + arg2 + ", children="; |
| 142 |
0
|
if (children == null) { |
| 143 |
0
|
s += "null"; |
| 144 |
|
} else { |
| 145 |
0
|
s += children; |
| 146 |
|
} |
| 147 |
0
|
s += "]"; |
| 148 |
0
|
return s; |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
|
| 152 |
|
@return |
| 153 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 154 |
0
|
public MessageMap getMessageMap() {... |
| 155 |
0
|
return this.messageMap; |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
|
| 159 |
|
@param |
| 160 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 161 |
0
|
public void setMessageMap(MessageMap messageMap) {... |
| 162 |
0
|
this.messageMap = messageMap; |
| 163 |
|
} |
| 164 |
|
} |