Author: epbernard
Date: 2009-04-09 07:45:43 -0400 (Thu, 09 Apr 2009)
New Revision: 16285
Modified:
search/trunk/src/main/java/org/hibernate/search/annotations/ClassBridge.java
search/trunk/src/main/java/org/hibernate/search/bridge/BridgeFactory.java
search/trunk/src/main/java/org/hibernate/search/impl/SearchFactoryImpl.java
Log:
HSEARCH-352 fix programmatic mapping failure due to global analyzerDef
HSEARCH-358 @ClassBridge.impl is no longer defaulted
Modified: search/trunk/src/main/java/org/hibernate/search/annotations/ClassBridge.java
===================================================================
---
search/trunk/src/main/java/org/hibernate/search/annotations/ClassBridge.java 2009-04-08
23:19:54 UTC (rev 16284)
+++
search/trunk/src/main/java/org/hibernate/search/annotations/ClassBridge.java 2009-04-09
11:45:43 UTC (rev 16285)
@@ -57,7 +57,7 @@
* User supplied class to manipulate document in
* whatever mysterious ways they wish to.
*/
- public Class impl() default void.class;
+ public Class<?> impl();
/**
* Array of fields to work with. The impl class
Modified: search/trunk/src/main/java/org/hibernate/search/bridge/BridgeFactory.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/bridge/BridgeFactory.java 2009-04-08
23:19:54 UTC (rev 16284)
+++ search/trunk/src/main/java/org/hibernate/search/bridge/BridgeFactory.java 2009-04-09
11:45:43 UTC (rev 16285)
@@ -113,7 +113,7 @@
FieldBridge bridge = null;
if ( cb != null ) {
- Class impl = cb.impl();
+ Class<?> impl = cb.impl();
//TODO better error information ( see guessType() )
if (impl != null) {
try {
@@ -141,7 +141,7 @@
}
}
catch (Exception e) {
- throw new HibernateException( "Unable to instantiate FieldBridge for " +
ClassBridge.class.getName(), e );
+ throw new HibernateException( "Unable to instantiate ClassBridge for " +
impl.getName(), e );
}
}
}
Modified: search/trunk/src/main/java/org/hibernate/search/impl/SearchFactoryImpl.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/impl/SearchFactoryImpl.java 2009-04-08
23:19:54 UTC (rev 16284)
+++ search/trunk/src/main/java/org/hibernate/search/impl/SearchFactoryImpl.java 2009-04-09
11:45:43 UTC (rev 16285)
@@ -458,6 +458,7 @@
private void initProgrammaticAnalyzers(InitContext context, ReflectionManager
reflectionManager) {
final Map defaults = reflectionManager.getDefaults();
+
if (defaults != null) {
AnalyzerDef[] defs = (AnalyzerDef[]) defaults.get( AnalyzerDefs.class );
if ( defs != null ) {