[hibernate-issues] [Hibernate-JIRA] Updated: (HSEARCH-597) Inconsistent treatment of extended FullTextIndexEventListener
Hardy Ferentschik (JIRA)
noreply at atlassian.com
Thu Aug 11 07:46:03 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hardy Ferentschik updated HSEARCH-597:
--------------------------------------
Description:
In my _hibernate.cfg.xml_ file I have specified my own hibernate event listener class that extends from _FullTextEventListener.java_. _ContextHelper_ nicely allows this (line 50):
{code}
if ( candidate instanceof FullTextIndexEventListener ) { ... }
{code}
However, with debug-level logging turned on, I see a number of log messages from _EventSourceTransactionContext_ line 116:
{noformat}
"FullTextIndexEventListener was not registered as FlushEventListener".
{noformat}
This is because it looks for an exact class match:
{code}
if ( listener.getClass().equals( FullTextIndexEventListener.class ) ) { ... }
{code}
Could we change this to be _FullTextIndexEventListener.class.isAssignableFrom(listener.getClass())_ instead?
I also noticed an == check for the same thing in _EventListenerRegister.isPresentInListeners()_.
was:
In my hibernate.cfg.xml file I have specified my own hibernate event listener class that extends from FullTextEventListener.java. ContextHelper nicely allows this (line 50):
if ( candidate instanceof FullTextIndexEventListener ) { ... }
However, with debug-level logging turned on, I see a number of log messages from EventSourceTransactionContext line 116 "FullTextIndexEventListener was not registered as FlushEventListener". This is because it looks for an exact class match:
if ( listener.getClass().equals( FullTextIndexEventListener.class ) ) { ... }
Could we change this to be FullTextIndexEventListener.class.isAssignableFrom(listener.getClass()) instead?
I also noticed an == check for the same thing in EventListenerRegister.isPresentInListeners().
> Inconsistent treatment of extended FullTextIndexEventListener
> -------------------------------------------------------------
>
> Key: HSEARCH-597
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-597
> Project: Hibernate Search
> Issue Type: Bug
> Components: engine
> Affects Versions: 3.2.0.Final
> Environment: Hibernate 3.5.3, SQL Server 2005
> Reporter: Ben Dotte
> Assignee: Sanne Grinovero
> Priority: Minor
> Fix For: 4.0.0.Alpha1
>
>
> In my _hibernate.cfg.xml_ file I have specified my own hibernate event listener class that extends from _FullTextEventListener.java_. _ContextHelper_ nicely allows this (line 50):
> {code}
> if ( candidate instanceof FullTextIndexEventListener ) { ... }
> {code}
> However, with debug-level logging turned on, I see a number of log messages from _EventSourceTransactionContext_ line 116:
> {noformat}
> "FullTextIndexEventListener was not registered as FlushEventListener".
> {noformat}
> This is because it looks for an exact class match:
> {code}
> if ( listener.getClass().equals( FullTextIndexEventListener.class ) ) { ... }
> {code}
> Could we change this to be _FullTextIndexEventListener.class.isAssignableFrom(listener.getClass())_ instead?
> I also noticed an == check for the same thing in _EventListenerRegister.isPresentInListeners()_.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list