Author: epbernard
Date: 2006-09-29 15:13:51 -0400 (Fri, 29 Sep 2006)
New Revision: 10536
Modified:
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/DocumentBuilder.java
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/bridge/DateBridge.java
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/event/LuceneEventListener.java
Log:
code cleaning, bug prevention
Modified:
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/DocumentBuilder.java
===================================================================
---
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/DocumentBuilder.java 2006-09-29
01:46:32 UTC (rev 10535)
+++
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/DocumentBuilder.java 2006-09-29
19:13:51 UTC (rev 10536)
@@ -91,7 +91,7 @@
private Float getBoost(AnnotatedElement element) {
if (element == null) return null;
Boost boost = element.getAnnotation( Boost.class );
- return boost != null ? new Float( boost.value() ) : null;
+ return boost != null ? Float.valueOf( boost.value() ) : null;
}
private Object getValue(Member member, T bean) {
Modified:
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/bridge/DateBridge.java
===================================================================
---
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/bridge/DateBridge.java 2006-09-29
01:46:32 UTC (rev 10535)
+++
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/bridge/DateBridge.java 2006-09-29
19:13:51 UTC (rev 10536)
@@ -13,7 +13,6 @@
* @author Emmanuel Bernard
*/
public class DateBridge implements StringBridge, ParameterizedBridge {
- //TODO don't depend on such a weak 3rd party API for a public API of ours
DateTools.Resolution resolution;
public Object stringToObject(String stringValue) {
Modified:
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/event/LuceneEventListener.java
===================================================================
---
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/event/LuceneEventListener.java 2006-09-29
01:46:32 UTC (rev 10535)
+++
branches/Lucene_Integration/HibernateExt/metadata/src/java/org/hibernate/lucene/event/LuceneEventListener.java 2006-09-29
19:13:51 UTC (rev 10536)
@@ -83,6 +83,11 @@
try {
analyzer = (Analyzer) analyzerClass.newInstance();
}
+ catch (ClassCastException e) {
+ throw new HibernateException(
+ "Lucene analyzer does not implement " + Analyzer.class.getName() + ":
" + analyzerClassName
+ );
+ }
catch (Exception e) {
throw new HibernateException( "Failed to instantiate lucene analyzer with type
" + analyzerClassName );
}
Show replies by date