Author: hardy.ferentschik
Date: 2008-08-01 04:15:25 -0400 (Fri, 01 Aug 2008)
New Revision: 15007
Modified:
annotations/tags/3.4.0.CR2/doc/reference/en/modules/setup.xml
annotations/tags/3.4.0.CR2/ivy.xml
annotations/tags/3.4.0.CR2/pom.xml
annotations/tags/3.4.0.CR2/src/java/org/hibernate/cfg/AnnotationConfiguration.java
annotations/tags/3.4.0.CR2/src/java/org/hibernate/cfg/search/HibernateSearchEventListenerRegister.java
Log:
Synced with core release 3.3.0.CR2
Switched to javassist as byecode provider for the tests.
Modified: annotations/tags/3.4.0.CR2/doc/reference/en/modules/setup.xml
===================================================================
--- annotations/tags/3.4.0.CR2/doc/reference/en/modules/setup.xml 2008-08-01 08:14:23 UTC
(rev 15006)
+++ annotations/tags/3.4.0.CR2/doc/reference/en/modules/setup.xml 2008-08-01 08:15:25 UTC
(rev 15007)
@@ -18,7 +18,7 @@
</listitem>
<listitem>
- <para>This release is known to work on Hibernate Core 3.3.CR1</para>
+ <para>This release is known to work on Hibernate Core
3.3.0.CR2</para>
</listitem>
<listitem>
Modified: annotations/tags/3.4.0.CR2/ivy.xml
===================================================================
--- annotations/tags/3.4.0.CR2/ivy.xml 2008-08-01 08:14:23 UTC (rev 15006)
+++ annotations/tags/3.4.0.CR2/ivy.xml 2008-08-01 08:15:25 UTC (rev 15007)
@@ -15,7 +15,7 @@
<!-- compile time dependencies -->
<dependency name="ejb3-persistence" rev="1.0.2.GA"
conf="default->default"/>
<dependency name="commons-annotations" rev="3.1.0.CR2"
conf="default->default"/>
- <dependency org="org.hibernate" name="hibernate-core"
rev="3.3.0.CR1" conf="default->default"/>
+ <dependency org="org.hibernate" name="hibernate-core"
rev="3.3.0.CR2" conf="default->default"/>
<dependency org="dom4j" name="dom4j" rev="1.6.1"
conf="default->default"/>
<dependency org="org.slf4j" name="slf4j-api"
rev="1.4.2" conf="default->default"/>
@@ -25,7 +25,7 @@
<dependency org="commons-collections"
name="commons-collections" rev="3.1"
conf="test->default"/>
<!-- test deps -->
- <dependency org="cglib" name="cglib" rev="2.1_3"
conf="test->default"/>
+ <dependency org="javassist" name="javassist"
rev="3.4.GA" conf="test->default"/>
<dependency org="asm" name="asm" rev="1.5.3"
conf="test->default"/>
<dependency org="asm" name="asm-attrs"
rev="1.5.3" conf="test->default"/>
<dependency org="javax.transaction" name="jta"
rev="1.1" conf="test->default"/>
Modified: annotations/tags/3.4.0.CR2/pom.xml
===================================================================
--- annotations/tags/3.4.0.CR2/pom.xml 2008-08-01 08:14:23 UTC (rev 15006)
+++ annotations/tags/3.4.0.CR2/pom.xml 2008-08-01 08:15:25 UTC (rev 15007)
@@ -35,7 +35,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
- <version>3.3.0.CR1</version>
+ <version>3.3.0.CR2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Modified:
annotations/tags/3.4.0.CR2/src/java/org/hibernate/cfg/AnnotationConfiguration.java
===================================================================
---
annotations/tags/3.4.0.CR2/src/java/org/hibernate/cfg/AnnotationConfiguration.java 2008-08-01
08:14:23 UTC (rev 15006)
+++
annotations/tags/3.4.0.CR2/src/java/org/hibernate/cfg/AnnotationConfiguration.java 2008-08-01
08:15:25 UTC (rev 15007)
@@ -61,14 +61,13 @@
* @author Emmanuel Bernard
* @author Hardy Ferentschik
*/
-@SuppressWarnings({"unchecked", "serial"})
public class AnnotationConfiguration extends Configuration {
private Logger log = LoggerFactory.getLogger( AnnotationConfiguration.class );
/**
* Class name of the class needed to enable Search.
*/
- private static final String SEARCH_STARTUP_CLASS =
"org.hibernate.search.cfg.EventListenerRegister";
+ private static final String SEARCH_STARTUP_CLASS =
"org.hibernate.search.event.EventListenerRegister";
/**
* Method to call to enable Search.
@@ -360,9 +359,8 @@
try {
Class classValidator = ReflectHelper.classForName(
"org.hibernate.validator.ClassValidator", this.getClass() );
Class messageInterpolator = ReflectHelper.classForName(
"org.hibernate.validator.MessageInterpolator", this.getClass() );
- validatorCtr = classValidator.getDeclaredConstructor( new Class[] {
+ validatorCtr = classValidator.getDeclaredConstructor(
Class.class, ResourceBundle.class, messageInterpolator, Map.class,
ReflectionManager.class
- }
);
applyMethod = classValidator.getMethod( "apply", PersistentClass.class );
}
@@ -827,9 +825,7 @@
if ( !present ) {
int length = listeners.length + 1;
PreInsertEventListener[] newListeners = new PreInsertEventListener[length];
- for (int i = 0; i < length - 1; i++) {
- newListeners[i] = listeners[i];
- }
+ System.arraycopy( listeners, 0, newListeners, 0, length - 1 );
newListeners[length - 1] = (PreInsertEventListener) validateEventListener;
getEventListeners().setPreInsertEventListeners( newListeners );
}
@@ -853,9 +849,7 @@
if ( !present ) {
int length = listeners.length + 1;
PreUpdateEventListener[] newListeners = new PreUpdateEventListener[length];
- for (int i = 0; i < length - 1; i++) {
- newListeners[i] = listeners[i];
- }
+ System.arraycopy( listeners, 0, newListeners, 0, length - 1 );
newListeners[length - 1] = (PreUpdateEventListener) validateEventListener;
getEventListeners().setPreUpdateEventListeners( newListeners );
}
@@ -879,7 +873,7 @@
*/
private void enableHibernateSearch() {
// load the bootstrap class
- Class searchStartupClass = null;
+ Class searchStartupClass;
try {
searchStartupClass = ReflectHelper.classForName(SEARCH_STARTUP_CLASS,
AnnotationConfiguration.class);
} catch ( ClassNotFoundException e ) {
Modified:
annotations/tags/3.4.0.CR2/src/java/org/hibernate/cfg/search/HibernateSearchEventListenerRegister.java
===================================================================
---
annotations/tags/3.4.0.CR2/src/java/org/hibernate/cfg/search/HibernateSearchEventListenerRegister.java 2008-08-01
08:14:23 UTC (rev 15006)
+++
annotations/tags/3.4.0.CR2/src/java/org/hibernate/cfg/search/HibernateSearchEventListenerRegister.java 2008-08-01
08:15:25 UTC (rev 15007)
@@ -18,7 +18,7 @@
/**
* Helper methods initializing Hibernate Search event listeners.
*
- * @deprecated as of release 3.4.0.CR2, replaced by Hibernate Search's {@link
org.hibernate.search.cfg.EventListenerBoostrap}
+ * @deprecated as of release 3.4.0.CR2, replaced by Hibernate Search's {@link
org.hibernate.search.cfg.EventListenerRegister}
* @author Emmanuel Bernard
* @author Hardy Ferentschik
*/
@@ -199,23 +199,20 @@
*
* @return An event listener instance in case the jar was available.
*/
- @SuppressWarnings("unchecked")
- private static Class attemptToLoadSearchEventListener() {
+ private static Class<?> attemptToLoadSearchEventListener() {
Class searchEventListenerClass = null;
try {
searchEventListenerClass = ReflectHelper.classForName(
FULL_TEXT_INDEX_EVENT_LISTENER_CLASS,
HibernateSearchEventListenerRegister.class);
} catch (ClassNotFoundException e) {
- log
- .debug("Search not present in classpath, ignoring event listener
registration.");
+ log.debug("Search not present in classpath, ignoring event listener
registration.");
}
return searchEventListenerClass;
}
- @SuppressWarnings("unchecked")
- private static Object instantiateEventListener(Class clazz) {
- Object searchEventListener = null;
+ private static Object instantiateEventListener(Class<?> clazz) {
+ Object searchEventListener;
try {
searchEventListener = clazz.newInstance();
} catch (Exception e) {