Skip to content

Package: ProcessedDiffFile

ProcessedDiffFile

nameinstructionbranchcomplexitylinemethod
ProcessedDiffFile(Set)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
equals(Object)
M: 13 C: 24
65%
M: 7 C: 5
42%
M: 6 C: 1
14%
M: 6 C: 7
54%
M: 0 C: 1
100%
getChanges()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hashCode()
M: 19 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
setChanges(Set)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
toString()
M: 33 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package migration.processeddifffile;
2:
3: import java.util.Iterator;
4: import java.util.Set;
5:
6: /**
7: * The result of the processing action of a difffile.
8: */
9: public class ProcessedDiffFile {
10:
11:         /**
12:          * the set of changes.
13:          */
14:         private Set<VariableDefinitionChange> changes;
15:
16:         /**
17:          * Creates a new ProcessedDiffFile for the list of changes.
18:          *
19:          * @param changes
20:          * the setof changes
21:          */
22:         public ProcessedDiffFile(final Set<VariableDefinitionChange> changes) {
23:                 this.changes = changes;
24:         }
25:
26:         /**
27:          * @return the list of changes
28:          */
29:         public Set<VariableDefinitionChange> getChanges() {
30:                 return changes;
31:         }
32:
33:         /**
34:          *
35:          * @param changes
36:          * the new list of changes
37:          */
38:         public void setChanges(final Set<VariableDefinitionChange> changes) {
39:                 this.changes = changes;
40:         }
41:
42:         @Override
43:         public String toString() {
44:                 final StringBuilder sb = new StringBuilder();
45:                 for (Iterator<VariableDefinitionChange> iterator = changes.iterator(); iterator
46:•                                .hasNext();) {
47:                         sb.append(iterator.next());
48:                         sb.append("\n");
49:                 }
50:                 return "ProcessedDiffFile: \n" + new String(sb);
51:         }
52:
53:         @Override
54:         public int hashCode() {
55:                 final int prime = 31;
56:                 int result = 1;
57:•                result = prime * result + ((changes == null)
58:                                 ? 0
59:                                 : changes.hashCode());
60:                 return result;
61:         }
62:
63:         @Override
64:         public boolean equals(final Object obj) {
65:•                if (this == obj) {
66:                         return true;
67:                 }
68:•                if (obj == null) {
69:                         return false;
70:                 }
71:•                if (getClass() != obj.getClass()) {
72:                         return false;
73:                 }
74:                 final ProcessedDiffFile other = (ProcessedDiffFile) obj;
75:•                if (changes == null) {
76:•                        if (other.changes != null) {
77:                                 return false;
78:                         }
79:•                } else if (!changes.equals(other.changes)) {
80:                         return false;
81:                 }
82:                 return true;
83:         }
84:
85: }