Skip to content

Commit 035cc7c

Browse files
committed
R convert to lambda
1 parent 8a1a1ad commit 035cc7c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

approvaltests-util/src/main/java/com/spun/util/tests/TestUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import com.spun.util.io.FileUtils;
99
import com.spun.util.io.StackElementLevelSelector;
1010
import com.spun.util.io.StackElementSelector;
11+
import org.lambda.functions.Function1;
12+
import org.lambda.functions.Function2;
13+
1114
import java.awt.image.BufferedImage;
1215
import java.io.File;
1316
import java.io.FileNotFoundException;
@@ -186,7 +189,8 @@ private static StackTraceReflectionResult getInfo(StackTraceElement element) thr
186189
String className = fullClassName.substring(fullClassName.lastIndexOf(".") + 1);
187190
className = handleInnerClasses(className);
188191
String fileName = element.getFileName();
189-
File dir = ClassUtils.getSourceDirectory(ObjectUtils.loadClass(fullClassName), fileName);
192+
Function2<Class, String, File> getSourceDirectory = ClassUtils::getSourceDirectory;
193+
File dir = getSourceDirectory.call(ObjectUtils.loadClass(fullClassName), fileName);
190194
String methodName = unrollLambda(element.getMethodName());
191195
return new StackTraceReflectionResult(dir, className, fullClassName, methodName);
192196
}

0 commit comments

Comments
 (0)