Skip to content

Commit

Permalink
Added Average{MinMax}.add(long), to make this backwards-compatible wi…
Browse files Browse the repository at this point in the history
…th 5.3.x
  • Loading branch information
belaban committed Oct 22, 2024
1 parent da6872a commit 73278bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/org/jgroups/util/Average.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public <T extends Average> T add(double num) {
return (T)this;
}

public <T extends Average> T add(long num) {
return add((double)num);
}

/** Merges this average with another one */
public <T extends Average> T merge(T other) {
if(other == null)
Expand Down
4 changes: 4 additions & 0 deletions src/org/jgroups/util/AverageMinMax.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public <T extends Average> T add(double num) {
return (T)this;
}

public <T extends Average> T add(long num) {
return add((double)num);
}

public <T extends Average> T merge(T other) {
if(other.count() == 0)
return (T)this;
Expand Down

0 comments on commit 73278bf

Please sign in to comment.