Author: sannegrinovero
Date: 2008-05-29 07:56:45 -0400 (Thu, 29 May 2008)
New Revision: 14708
Modified:
search/trunk/src/java/org/hibernate/search/engine/QueryLoader.java
Log:
use of Collections.EMPTY_LIST for empty results
Modified: search/trunk/src/java/org/hibernate/search/engine/QueryLoader.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/engine/QueryLoader.java 2008-05-29 11:50:15
UTC (rev 14707)
+++ search/trunk/src/java/org/hibernate/search/engine/QueryLoader.java 2008-05-29 11:56:45
UTC (rev 14708)
@@ -2,6 +2,7 @@
package org.hibernate.search.engine;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.hibernate.Criteria;
@@ -18,7 +19,6 @@
*/
public class QueryLoader implements Loader {
private static final int MAX_IN_CLAUSE = 500;
- private static final List EMPTY_LIST = new ArrayList( 0 );
private final Logger log = LoggerFactory.getLogger( QueryLoader.class );
private Session session;
@@ -35,7 +35,6 @@
this.entityType = entityType;
}
-
public Object load(EntityInfo entityInfo) {
//be sure to get an initialized object
Object maybeProxy = session.get( entityInfo.clazz, entityInfo.id );
@@ -57,7 +56,7 @@
public List load(EntityInfo... entityInfos) {
final int maxResults = entityInfos.length;
- if ( maxResults == 0 ) return EMPTY_LIST;
+ if ( maxResults == 0 ) return Collections.EMPTY_LIST;
if ( entityType == null ) throw new AssertionFailure( "EntityType not
defined" );
if ( criteria == null ) criteria = session.createCriteria( entityType );
Show replies by date