fixed NotificationListenerBean assertion in constructor (SPR-8091)

This commit is contained in:
Juergen Hoeller
2011-11-28 22:47:48 +00:00
parent c2eafdb2fb
commit 9f3e333084
2 changed files with 28 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2011 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.
@@ -20,6 +20,7 @@ import javax.management.NotificationListener;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.jmx.support.NotificationListenerHolder;
import org.springframework.util.Assert;
/**
* Helper class that aggregates a {@link javax.management.NotificationListener},
@@ -55,6 +56,7 @@ public class NotificationListenerBean extends NotificationListenerHolder impleme
* @param notificationListener the encapsulated listener
*/
public NotificationListenerBean(NotificationListener notificationListener) {
Assert.notNull(notificationListener, "NotificationListener must not be null");
setNotificationListener(notificationListener);
}