From 79774a045318ff6c837f18c9714232925becddb2 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Wed, 8 Feb 2012 07:36:21 -0600 Subject: [PATCH] HHH-7030 - EventListenerRegistry interface generic declaration is not extensible to subclasses --- .../event/service/internal/EventListenerRegistryImpl.java | 8 ++++---- .../event/service/spi/EventListenerRegistry.java | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/event/service/internal/EventListenerRegistryImpl.java b/hibernate-core/src/main/java/org/hibernate/event/service/internal/EventListenerRegistryImpl.java index 6735e28e78..c5dfc19dcd 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/service/internal/EventListenerRegistryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/event/service/internal/EventListenerRegistryImpl.java @@ -115,12 +115,12 @@ public class EventListenerRegistryImpl implements EventListenerRegistry { } @Override - public void setListeners(EventType type, Class... listenerClasses) { + public void setListeners(EventType type, Class... listenerClasses) { setListeners( type, resolveListenerInstances( type, listenerClasses ) ); } @SuppressWarnings( {"unchecked"}) - private T[] resolveListenerInstances(EventType type, Class... listenerClasses) { + private T[] resolveListenerInstances(EventType type, Class... listenerClasses) { T[] listeners = (T[]) Array.newInstance( type.baseListenerInterface(), listenerClasses.length ); for ( int i = 0; i < listenerClasses.length; i++ ) { listeners[i] = resolveListenerInstance( listenerClasses[i] ); @@ -162,7 +162,7 @@ public class EventListenerRegistryImpl implements EventListenerRegistry { } @Override - public void appendListeners(EventType type, Class... listenerClasses) { + public void appendListeners(EventType type, Class... listenerClasses) { appendListeners( type, resolveListenerInstances( type, listenerClasses ) ); } @@ -172,7 +172,7 @@ public class EventListenerRegistryImpl implements EventListenerRegistry { } @Override - public void prependListeners(EventType type, Class... listenerClasses) { + public void prependListeners(EventType type, Class... listenerClasses) { prependListeners( type, resolveListenerInstances( type, listenerClasses ) ); } diff --git a/hibernate-core/src/main/java/org/hibernate/event/service/spi/EventListenerRegistry.java b/hibernate-core/src/main/java/org/hibernate/event/service/spi/EventListenerRegistry.java index 29244d83b9..565a665fd8 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/service/spi/EventListenerRegistry.java +++ b/hibernate-core/src/main/java/org/hibernate/event/service/spi/EventListenerRegistry.java @@ -39,12 +39,12 @@ public interface EventListenerRegistry extends Service, Serializable { public void addDuplicationStrategy(DuplicationStrategy strategy); - public void setListeners(EventType type, Class... listeners); + public void setListeners(EventType type, Class... listeners); public void setListeners(EventType type, T... listeners); - public void appendListeners(EventType type, Class... listeners); + public void appendListeners(EventType type, Class... listeners); public void appendListeners(EventType type, T... listeners); - public void prependListeners(EventType type, Class... listeners); + public void prependListeners(EventType type, Class... listeners); public void prependListeners(EventType type, T... listeners); }