Skip to content

Commit 911b2b7

Browse files
committed
Fix the typo occurences -> occurrences
1 parent a938b12 commit 911b2b7

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/main/java/org/variantsync/diffdetective/metadata/EditClassCount.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@ public String toString() {
7676
*/
7777
public static InplaceSemigroup<EditClassCount> ISEMIGROUP() {
7878
return (a, b) -> MergeMap.putAllValues(
79-
a.occurences,
80-
b.occurences,
79+
a.occurrences,
80+
b.occurrences,
8181
Occurrences.ISEMIGROUP
8282
);
8383
}
8484

85-
private final LinkedHashMap<EditClass, Occurrences> occurences;
85+
private final LinkedHashMap<EditClass, Occurrences> occurrences;
8686

8787
/**
8888
* Create a new empty count that reports occurrences of the given edit class.
8989
* @param editClasses edit classes whose occurrences should be counted.
9090
*/
9191
public EditClassCount(final EditClassCatalogue editClasses) {
92-
occurences = new LinkedHashMap<>();
92+
occurrences = new LinkedHashMap<>();
9393
for (final EditClass p : editClasses.all()) {
94-
occurences.put(p, new Occurrences());
94+
occurrences.put(p, new Occurrences());
9595
}
9696
}
9797

@@ -106,16 +106,16 @@ public EditClassCount(final EditClassCatalogue editClasses) {
106106
*/
107107
public void reportOccurrenceFor(final EditClass editClass, CommitDiff commit) {
108108
Assert.assertTrue(
109-
occurences.containsKey(editClass),
109+
occurrences.containsKey(editClass),
110110
() -> "Reported unkown edit class \""
111111
+ editClass.getName()
112112
+ "\" but expected one of "
113-
+ occurences.keySet().stream()
113+
+ occurrences.keySet().stream()
114114
.map(EditClass::getName)
115115
.collect(Collectors.joining())
116116
+ "!"
117117
);
118-
occurences.get(editClass).increment(commit);
118+
occurrences.get(editClass).increment(commit);
119119
}
120120

121121
/**
@@ -156,7 +156,7 @@ public static EditClassCount parse(final List<String> lines, final String uuid)
156156
}
157157

158158
// add occurrence
159-
count.occurences.put(editClass, occurence);
159+
count.occurrences.put(editClass, occurence);
160160
}
161161

162162
return count;
@@ -165,7 +165,7 @@ public static EditClassCount parse(final List<String> lines, final String uuid)
165165
@Override
166166
public LinkedHashMap<String, String> snapshot() {
167167
return Functjonal.bimap(
168-
occurences,
168+
occurrences,
169169
EditClass::getName,
170170
Occurrences::toString,
171171
LinkedHashMap::new
@@ -174,7 +174,7 @@ public LinkedHashMap<String, String> snapshot() {
174174

175175
@Override
176176
public void setFromSnapshot(LinkedHashMap<String, String> snap) {
177-
for (var occurrence : occurences.entrySet()) {
177+
for (var occurrence : occurrences.entrySet()) {
178178
var editClass = occurrence.getKey();
179179
var value = snap.get(editClass.getName());
180180
if (value != null) {
@@ -192,7 +192,7 @@ public void setFromSnapshot(LinkedHashMap<String, String> snap) {
192192
}
193193

194194
// add occurrence
195-
occurences.put(editClass, occurence);
195+
occurrences.put(editClass, occurence);
196196
}
197197
}
198198
}
@@ -208,7 +208,7 @@ public InplaceSemigroup<EditClassCount> semigroup() {
208208
/**
209209
* Returns the current occurrence count for each considered edit class.
210210
*/
211-
public LinkedHashMap<EditClass, Occurrences> getOccurences() {
212-
return occurences;
211+
public LinkedHashMap<EditClass, Occurrences> getOccurrences() {
212+
return occurrences;
213213
}
214214
}

src/main/java/org/variantsync/diffdetective/tablegen/styles/ShortTable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private static List<ColumnDefinition> columns(final ShortTable t, final TriFunct
8282
col("\\#diffs", RIGHT, row -> t.makeReadable(row.get(StatisticsAnalysis.RESULT).processedTrees)),
8383
col("\\#artifact nodes", RIGHT_DASH, row -> t.makeReadable(row
8484
.get(EditClassCount.KEY)
85-
.getOccurences()
85+
.getOccurrences()
8686
.values().stream()
8787
.map(EditClassCount.Occurrences::getTotalAmount)
8888
.reduce(0, Integer::sum)
@@ -113,7 +113,7 @@ private static List<ColumnDefinition> columns(final ShortTable t, final TriFunct
113113
* @see column
114114
*/
115115
private static String absoluteCountOf(final ShortTable t, final EditClass editClass, final ContentRow row) {
116-
return t.makeReadable(row.get(EditClassCount.KEY).getOccurences().get(editClass).getTotalAmount());
116+
return t.makeReadable(row.get(EditClassCount.KEY).getOccurrences().get(editClass).getTotalAmount());
117117
}
118118

119119
/**
@@ -128,7 +128,7 @@ private static String absoluteCountOf(final ShortTable t, final EditClass editCl
128128
*/
129129
private static String relativeCountOf(final ShortTable t, final EditClass editClass, final ContentRow row) {
130130
final LinkedHashMap<EditClass, EditClassCount.Occurrences> editClassOccurrences =
131-
row.get(EditClassCount.KEY).getOccurences();
131+
row.get(EditClassCount.KEY).getOccurrences();
132132

133133
int numTotalMatches = 0;
134134
for (final Map.Entry<EditClass, EditClassCount.Occurrences> occurrence : editClassOccurrences.entrySet()) {

src/main/java/org/variantsync/diffdetective/tablegen/styles/Table1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public Table1() {
4040
));
4141

4242
for (final EditClass a : ProposedEditClasses.Instance.all()) {
43-
this.columnDefinitions.add(col(a.getName(), RIGHT, row -> makeReadable(row.get(EditClassCount.KEY).getOccurences().get(a).getTotalAmount())));
43+
this.columnDefinitions.add(col(a.getName(), RIGHT, row -> makeReadable(row.get(EditClassCount.KEY).getOccurrences().get(a).getTotalAmount())));
4444
}
4545

4646
this.columnDefinitions.add(col("runtime (s)", RIGHT, row -> makeReadable(row.get(StatisticsAnalysis.RESULT).runtimeInSeconds)));

src/main/java/org/variantsync/diffdetective/tablegen/styles/VariabilityShare.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private static boolean isEditToVariability(final EditClass c) {
5252

5353
/** Returns the number of occurrences of edit classes present in the table. */
5454
private static Stream<Map.Entry<EditClass, EditClassCount.Occurrences>> getVariationalEditClasses(final ContentRow row) {
55-
return row.get(EditClassCount.KEY).getOccurences().entrySet().stream()
55+
return row.get(EditClassCount.KEY).getOccurrences().entrySet().stream()
5656
.filter(entry -> isEditToVariability(entry.getKey()));
5757
}
5858

@@ -69,7 +69,7 @@ private static int countEditsToVariability(final ContentRow row) {
6969
*/
7070
private String getRelativeShareOf(final EditClass editClass, final ContentRow row) {
7171
final int totalAmount = countEditsToVariability(row);
72-
return makeReadable(100.0 * ((double)row.get(EditClassCount.KEY).getOccurences().get(editClass).getTotalAmount()) / ((double) totalAmount)) + "\\%";
72+
return makeReadable(100.0 * ((double)row.get(EditClassCount.KEY).getOccurrences().get(editClass).getTotalAmount()) / ((double) totalAmount)) + "\\%";
7373
}
7474

7575
/**

0 commit comments

Comments
 (0)