Skip to content

Commit

Permalink
Use default method.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Jul 26, 2024
1 parent d5a13de commit a9fb359
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions src/IKVM.Java.Extensions/java/util/function/DelegateConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,6 @@ namespace java.util.function
public class DelegateConsumer<T> : Consumer
{

/// <summary>
/// Joins two consumers into one.
/// </summary>
sealed class JoinConsumer : Consumer
{

readonly Consumer arg1;
readonly Consumer arg2;

/// <summary>
/// Initializes a new instance.
/// </summary>
/// <param name="arg1"></param>
/// <param name="arg2"></param>
internal JoinConsumer(Consumer arg1, Consumer arg2)
{
this.arg1 = arg1 ?? throw new ArgumentNullException(nameof(arg1));
this.arg2 = arg2 ?? throw new ArgumentNullException(nameof(arg2));
}

public void accept(object obj0)
{
arg1.accept(obj0);
arg2.accept(obj0);
}

public Consumer andThen(Consumer other)
{
return new JoinConsumer(this, other);
}

}

readonly Action<T> action;

/// <summary>
Expand All @@ -63,7 +30,7 @@ public void accept(object t)

public Consumer andThen(Consumer other)
{
return new JoinConsumer(this, other);
return Consumer.__DefaultMethods.andThen(this, other);
}

}
Expand Down

0 comments on commit a9fb359

Please sign in to comment.