Just curious: I've got the following code:
@Component
public class GoogleExceptionRetryClassifier implements Classifier<Throwable, Boolean>
{
private static final Collection<Classifier<Throwable, Boolean>> classifiers = new ArrayList<Classifier<Throwable, Boolean>>();
static
{
classifiers.add((tr) -> classInCauseChain(tr, UnknownHostException.class));
classifiers.add((tr) -> classInCauseChain(tr, SocketTimeoutException.class));
//vv--LINE BELOW!!!!--vv
classifiers.add(GoogleExceptionRetryClassifier::isGoogleHTTP5XXError);
}
...
}
Is there a way on the indicated line to avoid listing the current class? The method is a static method in the same class as the static initializer block. I realize I can't do this::isGoogleHTTP5XXError
because there is no instance yet, but it seems like it would be nice to have something like ::isGoogleHTTP5XXError
that would infer my current class without having to spell it out. Does this exist?