|
|
|
@ -16,7 +16,9 @@ import com.fr.log.FineLoggerFactory;
|
|
|
|
|
import com.fr.value.NotNullLazyValue; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
|
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -128,9 +130,11 @@ public class DetectorBridge {
|
|
|
|
|
* |
|
|
|
|
* @return 能够检测出的异常情况 |
|
|
|
|
*/ |
|
|
|
|
public Stream<DetectorResult> detect() { |
|
|
|
|
@NotNull |
|
|
|
|
public Collection<DetectorResult> detect() { |
|
|
|
|
|
|
|
|
|
return detectorManager.getValue().detect(); |
|
|
|
|
Stream<DetectorResult> results = detectorManager.getValue().detect(); |
|
|
|
|
return results.collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -141,10 +145,11 @@ public class DetectorBridge {
|
|
|
|
|
* @param throwable 异常 |
|
|
|
|
* @return 检测结果 |
|
|
|
|
*/ |
|
|
|
|
public Stream<DetectorResult> detect(Throwable throwable) { |
|
|
|
|
@NotNull |
|
|
|
|
public Collection<DetectorResult> detect(Throwable throwable) { |
|
|
|
|
|
|
|
|
|
ThrowableStore.getInstance().add(throwable); |
|
|
|
|
Stream<DetectorResult> result = detect(); |
|
|
|
|
Collection<DetectorResult> result = detect(); |
|
|
|
|
ThrowableStore.getInstance().reset(); |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|