Consistent not-null assertions for configured interceptors

Closes gh-25089
This commit is contained in:
Juergen Hoeller
2020-05-18 14:54:01 +02:00
parent 2785ef0887
commit 4ec02a7e53

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -93,11 +93,13 @@ public abstract class AbstractMessageChannel implements MessageChannel, Intercep
@Override
public void addInterceptor(ChannelInterceptor interceptor) {
Assert.notNull(interceptor, "ChannelInterceptor must not be null");
this.interceptors.add(interceptor);
}
@Override
public void addInterceptor(int index, ChannelInterceptor interceptor) {
Assert.notNull(interceptor, "ChannelInterceptor must not be null");
this.interceptors.add(index, interceptor);
}