Hibernate SVN: r14272 - validator/trunk/src/java/org/hibernate/validator.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-01-10 05:11:13 -0500 (Thu, 10 Jan 2008)
New Revision: 14272
Modified:
validator/trunk/src/java/org/hibernate/validator/Patterns.java
Log:
Modified: validator/trunk/src/java/org/hibernate/validator/Patterns.java
===================================================================
--- validator/trunk/src/java/org/hibernate/validator/Patterns.java 2008-01-10 05:55:30 UTC (rev 14271)
+++ validator/trunk/src/java/org/hibernate/validator/Patterns.java 2008-01-10 10:11:13 UTC (rev 14272)
@@ -11,7 +11,7 @@
/**
* The annotated element must follow the list of regexp patterns
*
- * @author Gavin King
+ * @author Emmanuel Bernard
*/
@Documented
@Target({METHOD, FIELD})
17 years, 1 month
Hibernate SVN: r14271 - core/trunk/core/src/main/java/org/hibernate/tuple.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-01-10 00:55:30 -0500 (Thu, 10 Jan 2008)
New Revision: 14271
Modified:
core/trunk/core/src/main/java/org/hibernate/tuple/EntityModeToTuplizerMapping.java
Log:
HHH-2645 : Synchronization bottleneck in EntityModeToTuplizerMapping
Modified: core/trunk/core/src/main/java/org/hibernate/tuple/EntityModeToTuplizerMapping.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/tuple/EntityModeToTuplizerMapping.java 2008-01-10 05:54:00 UTC (rev 14270)
+++ core/trunk/core/src/main/java/org/hibernate/tuple/EntityModeToTuplizerMapping.java 2008-01-10 05:55:30 UTC (rev 14271)
@@ -1,14 +1,13 @@
package org.hibernate.tuple;
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
+
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
+import org.hibernate.util.FastHashMap;
-import java.util.Map;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.io.Serializable;
-
/**
* Centralizes handling of {@link EntityMode} to {@link Tuplizer} mappings.
*
@@ -17,8 +16,16 @@
public abstract class EntityModeToTuplizerMapping implements Serializable {
// map of EntityMode -> Tuplizer
- private final Map tuplizers = Collections.synchronizedMap( new LinkedHashMap() );
+ private final Map tuplizers;
+ public EntityModeToTuplizerMapping() {
+ tuplizers = new FastHashMap();
+ }
+
+ public EntityModeToTuplizerMapping(Map tuplizers) {
+ this.tuplizers = tuplizers;
+ }
+
protected void addTuplizer(EntityMode entityMode, Tuplizer tuplizer) {
tuplizers.put( entityMode, tuplizer );
}
17 years, 1 month
Hibernate SVN: r14270 - core/branches/Branch_3_2/src/org/hibernate/tuple.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-01-10 00:54:00 -0500 (Thu, 10 Jan 2008)
New Revision: 14270
Modified:
core/branches/Branch_3_2/src/org/hibernate/tuple/EntityModeToTuplizerMapping.java
Log:
HHH-2645 : Synchronization bottleneck in EntityModeToTuplizerMapping
Modified: core/branches/Branch_3_2/src/org/hibernate/tuple/EntityModeToTuplizerMapping.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/tuple/EntityModeToTuplizerMapping.java 2008-01-07 18:58:18 UTC (rev 14269)
+++ core/branches/Branch_3_2/src/org/hibernate/tuple/EntityModeToTuplizerMapping.java 2008-01-10 05:54:00 UTC (rev 14270)
@@ -1,15 +1,13 @@
package org.hibernate.tuple;
-import org.apache.commons.collections.SequencedHashMap;
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
+import org.hibernate.util.FastHashMap;
-import java.util.Map;
-import java.util.Collections;
-import java.util.Iterator;
-import java.io.Serializable;
-
/**
* Centralizes handling of {@link EntityMode} to {@link Tuplizer} mappings.
*
@@ -18,8 +16,16 @@
public abstract class EntityModeToTuplizerMapping implements Serializable {
// map of EntityMode -> Tuplizer
- private final Map tuplizers = Collections.synchronizedMap( new SequencedHashMap() );
+ private final Map tuplizers;
+ public EntityModeToTuplizerMapping() {
+ tuplizers = new FastHashMap();
+ }
+
+ public EntityModeToTuplizerMapping(Map tuplizers) {
+ this.tuplizers = tuplizers;
+ }
+
protected void addTuplizer(EntityMode entityMode, Tuplizer tuplizer) {
tuplizers.put( entityMode, tuplizer );
}
17 years, 1 month
Hibernate SVN: r14269 - search/trunk/src/java/org/hibernate/search/backend/impl.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-01-07 13:58:18 -0500 (Mon, 07 Jan 2008)
New Revision: 14269
Modified:
search/trunk/src/java/org/hibernate/search/backend/impl/BatchedQueueingProcessor.java
Log:
HSEARCH-144 wait for the asynchronous work to end during app termination
Modified: search/trunk/src/java/org/hibernate/search/backend/impl/BatchedQueueingProcessor.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/impl/BatchedQueueingProcessor.java 2008-01-07 13:43:04 UTC (rev 14268)
+++ search/trunk/src/java/org/hibernate/search/backend/impl/BatchedQueueingProcessor.java 2008-01-07 18:58:18 UTC (rev 14269)
@@ -145,7 +145,10 @@
super.finalize();
//gracefully stop
//TODO move to the SF close lifecycle
- if ( executorService != null && !executorService.isShutdown() ) executorService.shutdown();
+ if ( executorService != null && !executorService.isShutdown() ) {
+ executorService.shutdown();
+ executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS );
+ }
}
}
17 years, 1 month
Hibernate SVN: r14268 - in search/trunk/src: test/org/hibernate/search/test/query and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-01-07 08:43:04 -0500 (Mon, 07 Jan 2008)
New Revision: 14268
Added:
search/trunk/src/java/org/hibernate/search/engine/LoaderHelper.java
search/trunk/src/test/org/hibernate/search/test/query/ObjectLoaderTest.java
Modified:
search/trunk/src/java/org/hibernate/search/engine/ObjectLoader.java
search/trunk/src/java/org/hibernate/search/engine/QueryLoader.java
search/trunk/src/test/org/hibernate/search/test/query/Author.java
search/trunk/src/test/org/hibernate/search/test/query/QueryLoaderTest.java
Log:
HSEARCH-146 ignore JPA EnitytNotFoundException
Added: search/trunk/src/java/org/hibernate/search/engine/LoaderHelper.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/engine/LoaderHelper.java (rev 0)
+++ search/trunk/src/java/org/hibernate/search/engine/LoaderHelper.java 2008-01-07 13:43:04 UTC (rev 14268)
@@ -0,0 +1,46 @@
+//$
+package org.hibernate.search.engine;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.annotations.common.util.ReflectHelper;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public abstract class LoaderHelper {
+ private static final List<Class> objectNotFoundExceptions;
+
+ static {
+ objectNotFoundExceptions = new ArrayList<Class>(2);
+ try {
+ objectNotFoundExceptions.add(
+ ReflectHelper.classForName( "org.hibernate.ObjectNotFoundException" )
+ );
+ }
+ catch (ClassNotFoundException e) {
+ //leave it alone
+ }
+ try {
+ objectNotFoundExceptions.add(
+ ReflectHelper.classForName( "javax.persistence.EntityNotFoundException" )
+ );
+ }
+ catch (ClassNotFoundException e) {
+ //leave it alone
+ }
+ }
+
+ public static boolean isObjectNotFoundException(RuntimeException e) {
+ boolean objectNotFound = false;
+ Class exceptionClass = e.getClass();
+ for ( Class clazz : objectNotFoundExceptions) {
+ if ( clazz.isAssignableFrom( exceptionClass ) ) {
+ objectNotFound = true;
+ break;
+ }
+ }
+ return objectNotFound;
+ }
+}
Modified: search/trunk/src/java/org/hibernate/search/engine/ObjectLoader.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/engine/ObjectLoader.java 2008-01-03 14:43:19 UTC (rev 14267)
+++ search/trunk/src/java/org/hibernate/search/engine/ObjectLoader.java 2008-01-07 13:43:04 UTC (rev 14268)
@@ -7,9 +7,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Hibernate;
-import org.hibernate.ObjectNotFoundException;
import org.hibernate.Session;
-import org.hibernate.search.engine.EntityInfo;
/**
* @author Emmanuel Bernard
@@ -28,10 +26,15 @@
try {
Hibernate.initialize( maybeProxy );
}
- catch (ObjectNotFoundException e) {
- log.debug( "Object found in Search index but not in database: "
- + e.getEntityName() + " wih id " + e.getIdentifier() );
- maybeProxy = null;
+ catch (RuntimeException e) {
+ if ( LoaderHelper.isObjectNotFoundException( e ) ) {
+ log.debug( "Object found in Search index but not in database: "
+ + entityInfo.clazz + " wih id " + entityInfo.id );
+ maybeProxy = null;
+ }
+ else {
+ throw e;
+ }
}
return maybeProxy;
}
@@ -42,16 +45,21 @@
for (EntityInfo entityInfo : entityInfos) {
session.load( entityInfo.clazz, entityInfo.id );
}
- List result = new ArrayList(entityInfos.length);
+ List result = new ArrayList( entityInfos.length );
for (EntityInfo entityInfo : entityInfos) {
try {
Object entity = session.load( entityInfo.clazz, entityInfo.id );
Hibernate.initialize( entity );
result.add( entity );
}
- catch (ObjectNotFoundException e) {
- log.debug( "Object found in Search index but not in database: "
- + e.getEntityName() + " wih id " + e.getIdentifier() );
+ catch (RuntimeException e) {
+ if ( LoaderHelper.isObjectNotFoundException( e ) ) {
+ log.debug( "Object found in Search index but not in database: "
+ + entityInfo.clazz + " wih id " + entityInfo.id );
+ }
+ else {
+ throw e;
+ }
}
}
return result;
Modified: search/trunk/src/java/org/hibernate/search/engine/QueryLoader.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/engine/QueryLoader.java 2008-01-03 14:43:19 UTC (rev 14267)
+++ search/trunk/src/java/org/hibernate/search/engine/QueryLoader.java 2008-01-07 13:43:04 UTC (rev 14268)
@@ -4,24 +4,22 @@
import java.util.ArrayList;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hibernate.Criteria;
+import org.hibernate.Hibernate;
import org.hibernate.Session;
-import org.hibernate.Hibernate;
-import org.hibernate.ObjectNotFoundException;
import org.hibernate.annotations.common.AssertionFailure;
import org.hibernate.criterion.Disjunction;
import org.hibernate.criterion.Restrictions;
-import org.hibernate.search.engine.EntityInfo;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
* @author Emmanuel Bernard
*/
public class QueryLoader implements Loader {
private static final int MAX_IN_CLAUSE = 500;
- private static final List EMPTY_LIST = new ArrayList(0);
- private static Log log = LogFactory.getLog( QueryLoader.class );
+ private static final List EMPTY_LIST = new ArrayList( 0 );
+ private static Log log = LogFactory.getLog( QueryLoader.class );
private Session session;
private Class entityType;
@@ -38,40 +36,44 @@
}
-
public Object load(EntityInfo entityInfo) {
//be sure to get an initialized object
Object maybeProxy = session.get( entityInfo.clazz, entityInfo.id );
try {
Hibernate.initialize( maybeProxy );
}
- catch (ObjectNotFoundException e) {
- log.debug( "Object found in Search index but not in database: "
- + e.getEntityName() + " wih id " + e.getIdentifier() );
- maybeProxy = null;
+ catch (RuntimeException e) {
+ if ( LoaderHelper.isObjectNotFoundException( e ) ) {
+ log.debug( "Object found in Search index but not in database: "
+ + entityInfo.clazz + " wih id " + entityInfo.id );
+ maybeProxy = null;
+ }
+ else {
+ throw e;
+ }
}
return maybeProxy;
}
public List load(EntityInfo... entityInfos) {
final int maxResults = entityInfos.length;
- if ( maxResults == 0) return EMPTY_LIST;
- if (entityType == null) throw new AssertionFailure("EntityType not defined");
- if (criteria == null) criteria = session.createCriteria( entityType );
+ if ( maxResults == 0 ) return EMPTY_LIST;
+ if ( entityType == null ) throw new AssertionFailure( "EntityType not defined" );
+ if ( criteria == null ) criteria = session.createCriteria( entityType );
DocumentBuilder builder = searchFactoryImplementor.getDocumentBuilders().get( entityType );
String idName = builder.getIdentifierName();
int loop = maxResults / MAX_IN_CLAUSE;
boolean exact = maxResults % MAX_IN_CLAUSE == 0;
- if (!exact) loop++;
+ if ( !exact ) loop++;
Disjunction disjunction = Restrictions.disjunction();
- for (int index = 0 ; index < loop ; index++) {
- int max = index*MAX_IN_CLAUSE + MAX_IN_CLAUSE <= maxResults ?
- index*MAX_IN_CLAUSE + MAX_IN_CLAUSE :
+ for (int index = 0; index < loop; index++) {
+ int max = index * MAX_IN_CLAUSE + MAX_IN_CLAUSE <= maxResults ?
+ index * MAX_IN_CLAUSE + MAX_IN_CLAUSE :
maxResults;
- List ids = new ArrayList(max - index*MAX_IN_CLAUSE);
- for (int entityInfoIndex = index * MAX_IN_CLAUSE ; entityInfoIndex < max ; entityInfoIndex++) {
- ids.add(entityInfos[entityInfoIndex].id);
+ List ids = new ArrayList( max - index * MAX_IN_CLAUSE );
+ for (int entityInfoIndex = index * MAX_IN_CLAUSE; entityInfoIndex < max; entityInfoIndex++) {
+ ids.add( entityInfos[entityInfoIndex].id );
}
disjunction.add( Restrictions.in( idName, ids ) );
}
@@ -79,7 +81,7 @@
criteria.list(); //load all objects
//mandatory to keep the same ordering
- List result = new ArrayList(entityInfos.length);
+ List result = new ArrayList( entityInfos.length );
for (EntityInfo entityInfo : entityInfos) {
Object element = session.load( entityInfo.clazz, entityInfo.id );
if ( Hibernate.isInitialized( element ) ) {
Modified: search/trunk/src/test/org/hibernate/search/test/query/Author.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/Author.java 2008-01-03 14:43:19 UTC (rev 14267)
+++ search/trunk/src/test/org/hibernate/search/test/query/Author.java 2008-01-07 13:43:04 UTC (rev 14268)
@@ -2,19 +2,23 @@
package org.hibernate.search.test.query;
import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.GeneratedValue;
+import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;
-import org.hibernate.search.annotations.Index;
/**
* @author Emmanuel Bernard
*/
@Entity
+@Indexed
public class Author {
- @Id @GeneratedValue private Integer id;
+ @Id @GeneratedValue @DocumentId
+ private Integer id;
private String name;
public Integer getId() {
Added: search/trunk/src/test/org/hibernate/search/test/query/ObjectLoaderTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/ObjectLoaderTest.java (rev 0)
+++ search/trunk/src/test/org/hibernate/search/test/query/ObjectLoaderTest.java 2008-01-07 13:43:04 UTC (rev 14268)
@@ -0,0 +1,56 @@
+//$
+package org.hibernate.search.test.query;
+
+import java.sql.Statement;
+import java.util.List;
+
+import org.hibernate.search.test.SearchTestCase;
+import org.hibernate.search.FullTextSession;
+import org.hibernate.search.Search;
+import org.hibernate.search.FullTextQuery;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.search.Query;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class ObjectLoaderTest extends SearchTestCase {
+
+ public void testObjectNotFound() throws Exception {
+ Session sess = openSession();
+ Transaction tx = sess.beginTransaction();
+ Author author = new Author();
+ author.setName( "Moo Cow" );
+ sess.persist( author );
+
+ tx.commit();
+ sess.clear();
+ Statement statement = sess.connection().createStatement();
+ statement.executeUpdate( "DELETE FROM Author" );
+ statement.close();
+ FullTextSession s = Search.createFullTextSession( sess );
+ tx = s.beginTransaction();
+ QueryParser parser = new QueryParser( "title", new KeywordAnalyzer() );
+ Query query = parser.parse( "name:moo" );
+ FullTextQuery hibQuery = s.createFullTextQuery( query, Author.class, Music.class );
+ List result = hibQuery.list();
+ assertEquals( "Should have returned no author", 0, result.size() );
+
+ for (Object o : s.createCriteria( Object.class ).list()) {
+ s.delete( o );
+ }
+
+ tx.commit();
+ s.close();
+ }
+
+ protected Class[] getMappings() {
+ return new Class[] {
+ Author.class,
+ Music.class
+ };
+ }
+}
Modified: search/trunk/src/test/org/hibernate/search/test/query/QueryLoaderTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/QueryLoaderTest.java 2008-01-03 14:43:19 UTC (rev 14267)
+++ search/trunk/src/test/org/hibernate/search/test/query/QueryLoaderTest.java 2008-01-07 13:43:04 UTC (rev 14268)
@@ -2,86 +2,85 @@
package org.hibernate.search.test.query;
import java.util.List;
+import java.sql.Statement;
-import org.hibernate.search.test.SearchTestCase;
-import org.hibernate.search.FullTextSession;
-import org.hibernate.search.FullTextQuery;
-import org.hibernate.search.Search;
-import org.hibernate.Transaction;
-import org.hibernate.Session;
+import org.apache.lucene.analysis.KeywordAnalyzer;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.Query;
-import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.search.FullTextQuery;
+import org.hibernate.search.FullTextSession;
+import org.hibernate.search.Search;
+import org.hibernate.search.test.SearchTestCase;
/**
* @author Emmanuel Bernard
*/
-public class
- QueryLoaderTest extends SearchTestCase {
+public class QueryLoaderTest extends SearchTestCase {
- public void testWithEagerCollectionLoad() throws Exception
- {
+ public void testWithEagerCollectionLoad() throws Exception {
Session sess = openSession();
Transaction tx = sess.beginTransaction();
Music music = new Music();
- music.setTitle("Moo Goes The Cow");
+ music.setTitle( "Moo Goes The Cow" );
Author author = new Author();
- author.setName("Moo Cow");
- music.addAuthor(author);
- sess.persist(author);
+ author.setName( "Moo Cow" );
+ music.addAuthor( author );
+ sess.persist( author );
author = new Author();
- author.setName("Another Moo Cow");
- music.addAuthor(author);
- sess.persist(author);
+ author.setName( "Another Moo Cow" );
+ music.addAuthor( author );
+ sess.persist( author );
author = new Author();
- author.setName("A Third Moo Cow");
- music.addAuthor(author);
- sess.persist(author);
+ author.setName( "A Third Moo Cow" );
+ music.addAuthor( author );
+ sess.persist( author );
author = new Author();
- author.setName("Random Moo Cow");
- music.addAuthor(author);
- sess.persist(author);
- sess.save(music);
+ author.setName( "Random Moo Cow" );
+ music.addAuthor( author );
+ sess.persist( author );
+ sess.save( music );
Music music2 = new Music();
- music2.setTitle("The Cow Goes Moo");
+ music2.setTitle( "The Cow Goes Moo" );
author = new Author();
- author.setName("Moo Cow The First");
- music2.addAuthor(author);
- sess.persist(author);
+ author.setName( "Moo Cow The First" );
+ music2.addAuthor( author );
+ sess.persist( author );
author = new Author();
- author.setName("Moo Cow The Second");
- music2.addAuthor(author);
- sess.persist(author);
+ author.setName( "Moo Cow The Second" );
+ music2.addAuthor( author );
+ sess.persist( author );
author = new Author();
- author.setName("Moo Cow The Third");
- music2.addAuthor(author);
- sess.persist(author);
+ author.setName( "Moo Cow The Third" );
+ music2.addAuthor( author );
+ sess.persist( author );
author = new Author();
- author.setName("Moo Cow The Fourth");
- music2.addAuthor(author);
- sess.persist(author);
- sess.save(music2);
+ author.setName( "Moo Cow The Fourth" );
+ music2.addAuthor( author );
+ sess.persist( author );
+ sess.save( music2 );
tx.commit();
sess.clear();
- FullTextSession s = Search.createFullTextSession(sess);
+ FullTextSession s = Search.createFullTextSession( sess );
tx = s.beginTransaction();
- QueryParser parser = new QueryParser("title", new KeywordAnalyzer());
- Query query = parser.parse("title:moo");
- FullTextQuery hibQuery = s.createFullTextQuery(query, Music.class);
+ QueryParser parser = new QueryParser( "title", new KeywordAnalyzer() );
+ Query query = parser.parse( "title:moo" );
+ FullTextQuery hibQuery = s.createFullTextQuery( query, Music.class );
List result = hibQuery.list();
- assertEquals("Should have returned 2 Books", 2, result.size());
+ assertEquals( "Should have returned 2 Books", 2, result.size() );
music = (Music) result.get( 0 );
- assertEquals("Book 1 should have four authors", 4, music.getAuthors().size());
+ assertEquals( "Book 1 should have four authors", 4, music.getAuthors().size() );
music2 = (Music) result.get( 1 );
- assertEquals("Book 2 should have four authors", 4, music2.getAuthors().size());
+ assertEquals( "Book 2 should have four authors", 4, music2.getAuthors().size() );
//cleanup
music.getAuthors().clear();
music2.getAuthors().clear();
- for (Object o : s.createCriteria( Object.class ).list() ) {
+ for (Object o : s.createCriteria( Object.class ).list()) {
s.delete( o );
}
17 years, 1 month
Hibernate SVN: r14267 - annotations/trunk/src/java/org/hibernate/cfg.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-01-03 09:43:19 -0500 (Thu, 03 Jan 2008)
New Revision: 14267
Modified:
annotations/trunk/src/java/org/hibernate/cfg/AnnotationConfiguration.java
Log:
Document bug
Modified: annotations/trunk/src/java/org/hibernate/cfg/AnnotationConfiguration.java
===================================================================
--- annotations/trunk/src/java/org/hibernate/cfg/AnnotationConfiguration.java 2008-01-03 14:41:32 UTC (rev 14266)
+++ annotations/trunk/src/java/org/hibernate/cfg/AnnotationConfiguration.java 2008-01-03 14:43:19 UTC (rev 14267)
@@ -399,6 +399,7 @@
compare = -1;
}
else if ( f1.hashCode() == f2.hashCode() ) {
+ //FIXME (do not use the hashCode as two objects can have identical hashCode values)
compare = 0;
}
else {
17 years, 2 months
Hibernate SVN: r14266 - entitymanager/trunk/src/java/org/hibernate/ejb/packaging.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-01-03 09:41:32 -0500 (Thu, 03 Jan 2008)
New Revision: 14266
Modified:
entitymanager/trunk/src/java/org/hibernate/ejb/packaging/JarVisitor.java
Log:
comments on method usage
Modified: entitymanager/trunk/src/java/org/hibernate/ejb/packaging/JarVisitor.java
===================================================================
--- entitymanager/trunk/src/java/org/hibernate/ejb/packaging/JarVisitor.java 2007-12-24 16:01:02 UTC (rev 14265)
+++ entitymanager/trunk/src/java/org/hibernate/ejb/packaging/JarVisitor.java 2008-01-03 14:41:32 UTC (rev 14266)
@@ -40,6 +40,7 @@
/**
* Get the JAR URL of the JAR containing the given entry
+ * Method used in a non managed environment
*
* @param url URL pointing to the known file in the JAR
* @param entry file known to be in the JAR
@@ -93,6 +94,23 @@
}
/**
+ * Get a JarVisitor to the jar <code>jarPath</code> applying the given filters
+ *
+ * Method used in a non-managed environment
+ *
+ * @throws IllegalArgumentException if the jarPath is incorrect
+ */
+ public static final JarVisitor getVisitor(String jarPath, Filter[] filters) throws IllegalArgumentException {
+ File file = new File( jarPath );
+ if ( file.isFile() ) {
+ return new InputStreamZippedJarVisitor( jarPath, filters );
+ }
+ else {
+ return new ExplodedJarVisitor( jarPath, filters );
+ }
+ }
+
+ /**
* Build a JarVisitor on the given JAR URL applying the given filters
*
* @throws IllegalArgumentException if the URL is malformed
@@ -180,21 +198,6 @@
initFilters( filters );
}
- /**
- * Get a JarVisitor to the jar <code>jarPath</code> applying the given filters
- *
- * @throws IllegalArgumentException if the jarPath is incorrect
- */
- public static final JarVisitor getVisitor(String jarPath, Filter[] filters) throws IllegalArgumentException {
- File file = new File( jarPath );
- if ( file.isFile() ) {
- return new InputStreamZippedJarVisitor( jarPath, filters );
- }
- else {
- return new ExplodedJarVisitor( jarPath, filters );
- }
- }
-
private JarVisitor(URL url) {
jarUrl = url;
unqualify();
17 years, 2 months