Author: sannegrinovero
Date: 2008-06-02 20:34:56 -0400 (Mon, 02 Jun 2008)
New Revision: 14725
Modified:
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java
search/trunk/src/java/org/hibernate/search/query/FullTextQueryImpl.java
Log:
trivial improvements about use of java.util Collections
Modified:
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java
===================================================================
---
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java 2008-06-02
22:55:36 UTC (rev 14724)
+++
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java 2008-06-03
00:34:56 UTC (rev 14725)
@@ -2,7 +2,7 @@
package org.hibernate.search.backend;
import java.io.Serializable;
-import java.util.HashMap;
+import java.util.EnumMap;
import java.util.Map;
import java.util.Properties;
@@ -81,7 +81,7 @@
private static final long serialVersionUID = -6121723702279869524L;
- final Map<IndexWriterSetting, Integer> parameters = new
HashMap<IndexWriterSetting, Integer>();
+ final Map<IndexWriterSetting, Integer> parameters = new
EnumMap<IndexWriterSetting, Integer>(IndexWriterSetting.class);
public ParameterSet(Properties prop, String paramName) {
//don't iterate on property entries as we know all the keys:
Modified: search/trunk/src/java/org/hibernate/search/query/FullTextQueryImpl.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/query/FullTextQueryImpl.java 2008-06-02
22:55:36 UTC (rev 14724)
+++ search/trunk/src/java/org/hibernate/search/query/FullTextQueryImpl.java 2008-06-03
00:34:56 UTC (rev 14725)
@@ -66,7 +66,7 @@
//TODO implements setParameter()
public class FullTextQueryImpl extends AbstractQueryImpl implements FullTextQuery {
private final Logger log = LoggerFactory.getLogger( FullTextQueryImpl.class );
- private org.apache.lucene.search.Query luceneQuery;
+ private final org.apache.lucene.search.Query luceneQuery;
private Class[] classes;
private Set<Class> classesAndSubclasses;
//optimization: if we can avoid the filter clause (we can most of the time) do it as it
has a significant perf impact
@@ -124,7 +124,7 @@
//find the directories
IndexSearcher searcher = buildSearcher( searchFactoryImplementor );
if ( searcher == null ) {
- return new IteratorImpl( new ArrayList<EntityInfo>( 0 ), noLoader );
+ return new IteratorImpl( Collections.EMPTY_LIST, noLoader );
}
try {
Hits hits = getHits( searcher );
@@ -234,7 +234,7 @@
SearchFactoryImplementor searchFactoryImplementor =
ContextHelper.getSearchFactoryBySFI( session );
//find the directories
IndexSearcher searcher = buildSearcher( searchFactoryImplementor );
- if ( searcher == null ) return new ArrayList( 0 );
+ if ( searcher == null ) return Collections.EMPTY_LIST;
Hits hits;
try {
hits = getHits( searcher );
Show replies by date