Skip to content

Commit

Permalink
Fixed the error in the DEFAULT instance
Browse files Browse the repository at this point in the history
  • Loading branch information
marcingrzejszczak committed Nov 4, 2022
1 parent 2551952 commit 2392312
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/src/main/java/feign/ClientInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@
*/
public interface ClientInterceptor {

ClientInterceptor DEFAULT = (context, iterator) -> null;
/**
* Returns the default instance of {@link ClientInterceptor}. We don't need to check if the
* iterator has a next entry because the {@link SynchronousMethodHandler} will add 1 entry. That
* means that in the default scenario an iterator to that entry will be passed here.
*/
ClientInterceptor DEFAULT = (context, iterator) -> {
ClientInterceptor next = iterator.next();
return next.around(context, iterator);
};

/**
* Allows to make an around instrumentation. Remember to call the next interceptor by calling
Expand Down

0 comments on commit 2392312

Please sign in to comment.