Skip to content

Commit a130e93

Browse files
authored
Fixed sonar warnings.
1 parent 7c99339 commit a130e93

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/com/github/underscore/Underscore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2182,7 +2182,7 @@ public T get() {
21822182
* Documented, #wrap
21832183
*/
21842184
public static <T> Function<Void, T> wrap(
2185-
final Function<T, T> function, final Function<Function<T, T>, T> wrapper) {
2185+
final UnaryOperator<T> function, final Function<UnaryOperator<T>, T> wrapper) {
21862186
return arg -> wrapper.apply(function);
21872187
}
21882188

src/test/java/com/github/underscore/FunctionsTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import java.util.function.Function;
3838
import java.util.function.Predicate;
3939
import java.util.function.Supplier;
40+
import java.util.function.UnaryOperator;
41+
4042
import org.junit.jupiter.api.Test;
4143

4244
/**
@@ -250,7 +252,7 @@ void once() {
250252
*/
251253
@Test
252254
void wrap() {
253-
Function<String, String> hello = name -> "hello: " + name;
255+
UnaryOperator<String> hello = name -> "hello: " + name;
254256
Function<Void, String> result =
255257
Underscore.wrap(hello, func -> "before, " + func.apply("moe") + ", after");
256258
assertEquals("before, hello: moe, after", result.apply(null));

0 commit comments

Comments
 (0)