| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
package org.itracker.model; |
| 20 |
|
|
| 21 |
|
import java.io.Serializable; |
| 22 |
|
import java.util.ArrayList; |
| 23 |
|
import java.util.Comparator; |
| 24 |
|
import java.util.List; |
| 25 |
|
|
| 26 |
|
import org.apache.commons.lang.builder.CompareToBuilder; |
| 27 |
|
import org.apache.commons.lang.builder.ToStringBuilder; |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
@author |
| 35 |
|
|
|
|
|
| 40.3% |
Uncovered Elements: 40 (67) |
Complexity: 34 |
Complexity Density: 1.03 |
|
| 36 |
|
public class Issue extends AbstractEntity implements Comparable<Entity> { |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
private static final long serialVersionUID = 1L; |
| 42 |
|
public static final Comparator<Issue> STATUS_COMPARATOR = |
| 43 |
|
new StatusComparator(); |
| 44 |
|
|
| 45 |
|
public static final Comparator<Issue> PROJECT_AND_STATUS_COMPARATOR = |
| 46 |
|
new ProjectAndStatusComparator(); |
| 47 |
|
|
| 48 |
|
public static final Comparator<Issue> OWNER_AND_STATUS_COMPARATOR = |
| 49 |
|
new OwnerAndStatusComparator(); |
| 50 |
|
|
| 51 |
|
public static final Comparator<Issue> SEVERITY_COMPARATOR = |
| 52 |
|
new SeverityComparator(); |
| 53 |
|
|
| 54 |
|
private String description; |
| 55 |
|
|
| 56 |
|
private Integer severity; |
| 57 |
|
|
| 58 |
|
private Integer status; |
| 59 |
|
|
| 60 |
|
|
| 61 |
|
private String resolution; |
| 62 |
|
|
| 63 |
|
private Project project; |
| 64 |
|
|
| 65 |
|
|
| 66 |
|
|
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
private User creator; |
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
private User owner; |
| 81 |
|
|
| 82 |
|
|
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 87 |
|
private Version targetVersion; |
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
private List<Component> components = new ArrayList<Component>(); |
| 96 |
|
|
| 97 |
|
|
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
private List<Version> versions = new ArrayList<Version>(); |
| 103 |
|
|
| 104 |
|
|
| 105 |
|
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
|
private List<IssueField> fields = new ArrayList<IssueField>(); |
| 110 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| 114 |
|
|
| 115 |
|
|
| 116 |
|
private List<IssueAttachment> attachments = new ArrayList<IssueAttachment>(); |
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
|
| 121 |
|
|
| 122 |
|
|
| 123 |
|
private List<IssueRelation> relations = new ArrayList<IssueRelation>(); |
| 124 |
|
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
| 128 |
|
|
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
private List<Notification> notifications = new ArrayList<Notification>(); |
| 136 |
|
|
| 137 |
|
|
| 138 |
|
|
| 139 |
|
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
private List<IssueActivity> activities = new ArrayList<IssueActivity>(); |
| 144 |
|
|
| 145 |
|
|
| 146 |
|
|
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 151 |
|
private List<IssueHistory> history = new ArrayList<IssueHistory>(); |
| 152 |
|
|
| 153 |
|
|
| 154 |
|
|
| 155 |
|
|
| 156 |
|
|
| 157 |
|
|
| 158 |
|
|
| 159 |
|
|
| 160 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 161 |
8
|
public Issue() {... |
| 162 |
|
} |
| 163 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 164 |
0
|
public List<IssueActivity> getActivities() {... |
| 165 |
0
|
return activities; |
| 166 |
|
} |
| 167 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 168 |
0
|
public void setActivities(List<IssueActivity> activities) {... |
| 169 |
0
|
this.activities = activities; |
| 170 |
|
} |
| 171 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 172 |
0
|
public List<IssueAttachment> getAttachments() {... |
| 173 |
0
|
return attachments; |
| 174 |
|
} |
| 175 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 176 |
1
|
public void setAttachments(List<IssueAttachment> attachments) {... |
| 177 |
1
|
this.attachments = attachments; |
| 178 |
|
} |
| 179 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 180 |
0
|
public List<Component> getComponents() {... |
| 181 |
0
|
return components; |
| 182 |
|
} |
| 183 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 184 |
1
|
public void setComponents(List<Component> components) {... |
| 185 |
1
|
this.components = components; |
| 186 |
|
} |
| 187 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 188 |
0
|
public User getCreator() {... |
| 189 |
0
|
return creator; |
| 190 |
|
} |
| 191 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 192 |
1
|
public void setCreator(User creator) {... |
| 193 |
1
|
this.creator = creator; |
| 194 |
|
} |
| 195 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 196 |
0
|
public String getDescription() {... |
| 197 |
0
|
return description; |
| 198 |
|
} |
| 199 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 200 |
1
|
public void setDescription(String description) {... |
| 201 |
1
|
this.description = description; |
| 202 |
|
} |
| 203 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 204 |
0
|
public List<IssueField> getFields() {... |
| 205 |
0
|
return fields; |
| 206 |
|
} |
| 207 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 208 |
1
|
public void setFields(List<IssueField> fields) {... |
| 209 |
1
|
this.fields = fields; |
| 210 |
|
} |
| 211 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 212 |
0
|
public List<IssueHistory> getHistory() {... |
| 213 |
0
|
return history; |
| 214 |
|
} |
| 215 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 216 |
1
|
public void setHistory(List<IssueHistory> history) {... |
| 217 |
1
|
this.history = history; |
| 218 |
|
} |
| 219 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 220 |
0
|
public List<Notification> getNotifications() {... |
| 221 |
0
|
return notifications; |
| 222 |
|
} |
| 223 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 224 |
0
|
public void setNotifications(List<Notification> notifications) {... |
| 225 |
0
|
this.notifications = notifications; |
| 226 |
|
} |
| 227 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 228 |
0
|
public User getOwner() {... |
| 229 |
0
|
return owner; |
| 230 |
|
} |
| 231 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 232 |
1
|
public void setOwner(User owner) {... |
| 233 |
1
|
this.owner = owner; |
| 234 |
|
} |
| 235 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 236 |
0
|
public Project getProject() {... |
| 237 |
0
|
return project; |
| 238 |
|
} |
| 239 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 240 |
1
|
public void setProject(Project project) {... |
| 241 |
1
|
this.project = project; |
| 242 |
|
} |
| 243 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 244 |
0
|
public List<IssueRelation> getRelations() {... |
| 245 |
0
|
return relations; |
| 246 |
|
} |
| 247 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 248 |
0
|
public void setRelations(List<IssueRelation> relations) {... |
| 249 |
0
|
this.relations = relations; |
| 250 |
|
} |
| 251 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 252 |
0
|
public String getResolution() {... |
| 253 |
0
|
return resolution; |
| 254 |
|
} |
| 255 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 256 |
1
|
public void setResolution(String resolution) {... |
| 257 |
1
|
this.resolution = resolution; |
| 258 |
|
} |
| 259 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 260 |
0
|
public Integer getSeverity() {... |
| 261 |
0
|
return severity; |
| 262 |
|
} |
| 263 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 264 |
1
|
public void setSeverity(Integer severity) {... |
| 265 |
1
|
this.severity = severity; |
| 266 |
|
} |
| 267 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 268 |
0
|
public Integer getStatus() {... |
| 269 |
0
|
return status; |
| 270 |
|
} |
| 271 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 272 |
1
|
public void setStatus(int status) {... |
| 273 |
1
|
this.status = status; |
| 274 |
|
} |
| 275 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 276 |
0
|
public Version getTargetVersion() {... |
| 277 |
0
|
return targetVersion; |
| 278 |
|
} |
| 279 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 280 |
1
|
public void setTargetVersion(Version targetVersion) {... |
| 281 |
1
|
this.targetVersion = targetVersion; |
| 282 |
|
} |
| 283 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 284 |
0
|
public List<Version> getVersions() {... |
| 285 |
0
|
return versions; |
| 286 |
|
} |
| 287 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 288 |
1
|
public void setVersions(List<Version> versions) {... |
| 289 |
1
|
this.versions = versions; |
| 290 |
|
} |
| 291 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 292 |
0
|
@Override... |
| 293 |
|
public String toString() { |
| 294 |
0
|
return new ToStringBuilder(this).append("id", getId()).append("description", getDescription()).append("owner", getOwner()).append("severity", getSeverity()).append("status", getStatus()).append("targetVersion", getTargetVersion()).toString(); |
| 295 |
|
} |
| 296 |
|
|
| 297 |
|
|
| 298 |
|
|
| 299 |
|
|
| 300 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 1 |
|
| 301 |
|
private static class StatusComparator implements Comparator<Issue>, Serializable { |
| 302 |
|
|
| 303 |
|
|
| 304 |
|
|
| 305 |
|
private static final long serialVersionUID = 1L; |
| 306 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 307 |
0
|
public int compare(Issue a, Issue b) {... |
| 308 |
0
|
return new CompareToBuilder().append(a.getStatus(), b.getStatus()).append(a.getSeverity(), b.getSeverity()).append(a.getId(), b.getId()).toComparison(); |
| 309 |
|
} |
| 310 |
|
|
| 311 |
|
} |
| 312 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 1 |
|
| 313 |
|
private static class ProjectAndStatusComparator implements Comparator<Issue>, Serializable { |
| 314 |
|
|
| 315 |
|
|
| 316 |
|
|
| 317 |
|
private static final long serialVersionUID = 1L; |
| 318 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 319 |
0
|
public int compare(Issue a, Issue b) {... |
| 320 |
0
|
return new CompareToBuilder().append(a.getProject(), b.getProject(), Project.PROJECT_COMPARATOR).append(a.getStatus(), b.getStatus()).append(a.getId(), b.getId()).toComparison(); |
| 321 |
|
} |
| 322 |
|
|
| 323 |
|
} |
| 324 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 1 |
|
| 325 |
|
private static class OwnerAndStatusComparator implements Comparator<Issue>, Serializable { |
| 326 |
|
|
| 327 |
|
|
| 328 |
|
|
| 329 |
|
private static final long serialVersionUID = 1L; |
| 330 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 331 |
0
|
public int compare(Issue a, Issue b) {... |
| 332 |
|
|
| 333 |
0
|
return new CompareToBuilder().append(a.getOwner(), b.getOwner(), User.NAME_COMPARATOR).append(a.getStatus(), b.getStatus()).append(a.getId(), b.getId()).toComparison(); |
| 334 |
|
|
| 335 |
|
} |
| 336 |
|
} |
| 337 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 1 |
|
| 338 |
|
private static class SeverityComparator implements Comparator<Issue>, Serializable { |
| 339 |
|
|
| 340 |
|
|
| 341 |
|
|
| 342 |
|
private static final long serialVersionUID = 1L; |
| 343 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 344 |
0
|
public int compare(Issue a, Issue b) {... |
| 345 |
|
|
| 346 |
0
|
return new CompareToBuilder().append(a.getSeverity(), b.getSeverity()).append(a.getStatus(), b.getStatus()).append(a.getId(), b.getId()).toComparison(); |
| 347 |
|
} |
| 348 |
|
|
| 349 |
|
} |
| 350 |
|
|
| 351 |
|
} |