Skip to content

Commit a86f6d3

Browse files
committed
ApplicationEventPublisher as functional interface
Issue: SPR-14699
1 parent 915350d commit a86f6d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spring-context/src/main/java/org/springframework/context/ApplicationEventPublisher.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
2828
* @see org.springframework.context.ApplicationEvent
2929
* @see org.springframework.context.event.EventPublicationInterceptor
3030
*/
31+
@FunctionalInterface
3132
public interface ApplicationEventPublisher {
3233

3334
/**
@@ -37,7 +38,9 @@ public interface ApplicationEventPublisher {
3738
* @param event the event to publish
3839
* @see org.springframework.web.context.support.RequestHandledEvent
3940
*/
40-
void publishEvent(ApplicationEvent event);
41+
default void publishEvent(ApplicationEvent event) {
42+
publishEvent((Object) event);
43+
}
4144

4245
/**
4346
* Notify all <strong>matching</strong> listeners registered with this

0 commit comments

Comments
 (0)