草庐IT

StackTractTest

全部标签

java - 使用方法引用与 lambda 时,堆栈跟踪的可导航性是否较低?

我刚刚在Eclipse中进行了快速试验。publicclassStackTractTest{staticclassNasty{publicIntegertoInt(){if(1==1)thrownewRuntimeException();return1;}}@TestpublicvoidmethodReference(){Stream.of(newNasty()).map(Nasty::toInt).findFirst();}@Testpublicvoidlambda(){Stream.of(newNasty()).map(n->n.toInt()).findFirst();}}当方法