Revisit Assert to avoid single-arg assert methods (with refined messages)
Issue: SPR-15196
(cherry picked from commit 1b2dc36)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -135,7 +135,6 @@ public abstract class AbstractEntityManagerFactoryBean implements
|
||||
* @see javax.persistence.Persistence
|
||||
*/
|
||||
public void setPersistenceProviderClass(Class<? extends PersistenceProvider> persistenceProviderClass) {
|
||||
Assert.isAssignable(PersistenceProvider.class, persistenceProviderClass);
|
||||
this.persistenceProvider = BeanUtils.instantiateClass(persistenceProviderClass);
|
||||
}
|
||||
|
||||
@@ -217,7 +216,6 @@ public abstract class AbstractEntityManagerFactoryBean implements
|
||||
* @see JpaVendorAdapter#getEntityManagerFactoryInterface()
|
||||
*/
|
||||
public void setEntityManagerFactoryInterface(Class<? extends EntityManagerFactory> emfInterface) {
|
||||
Assert.isAssignable(EntityManagerFactory.class, emfInterface);
|
||||
this.entityManagerFactoryInterface = emfInterface;
|
||||
}
|
||||
|
||||
@@ -231,7 +229,6 @@ public abstract class AbstractEntityManagerFactoryBean implements
|
||||
* @see EntityManagerFactoryInfo#getEntityManagerInterface()
|
||||
*/
|
||||
public void setEntityManagerInterface(Class<? extends EntityManager> emInterface) {
|
||||
Assert.isAssignable(EntityManager.class, emInterface);
|
||||
this.entityManagerInterface = emInterface;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -68,7 +68,6 @@ public class SharedEntityManagerBean extends EntityManagerFactoryAccessor
|
||||
*/
|
||||
public void setEntityManagerInterface(Class<? extends EntityManager> entityManagerInterface) {
|
||||
Assert.notNull(entityManagerInterface, "'entityManagerInterface' must not be null");
|
||||
Assert.isAssignable(EntityManager.class, entityManagerInterface);
|
||||
this.entityManagerInterface = entityManagerInterface;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -122,7 +122,7 @@ public class HibernateJpaDialect extends DefaultJpaDialect {
|
||||
}
|
||||
}
|
||||
// Check that it is the Hibernate FlushMode type, not JPA's...
|
||||
Assert.state(FlushMode.class == getFlushMode.getReturnType());
|
||||
Assert.state(FlushMode.class == getFlushMode.getReturnType(), "Could not find Hibernate getFlushMode method");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user