Issue 1:
Stepan Koltsov opened SPR-8528 and commented

Spring javaconf by default allows to override bean definitions. This could cause hard to find bean name collisions made by mistake in large projects.

To avoid this problem Spring provides GenericApplicationContext.setAllowBeanDefinitionOverriding(false). This helps to resolve name collision problems, but it makes impossible (or very hard) reuse of context configuration with minor adjustments (reuse 100 beans, redefine one or two).

I propose @Bean(override=true) parameter.

With @Bean(override=true) new bean is only registered if there already exists a bean with same name. Previous bean definition is removed during this bean registration.

It is an error if @Bean(override=true) overrides nothing.

allowBeanDefinitionOverriding value is ignored when @Bean(override=true)

@Bean(override=true) works for context similarly to how @Override works for classes and interfaces.

Affects: 3.1 M2

Issue Links:

#12637 Support profile exclusivity and/or bean definition finality ("duplicates")

Issue 2:
Keesun Baik opened SPR-3405 and commented

Chapter 8

8.3.5.1's @ExpectedException

and if <<an an>> instance of the exception is thrown during the test method execution then the test is considered to have passed (likewise if <<an an>> instance of the exception is not thrown during the test method execution then the test is considered to have failed.

there are two "an"s

Chapter 9

9.6.1.1. Specifying transaction settings's example code has an double quater at the end.

<bean id="sharedTransactionTemplate"

class="org.springframework.transaction.support.TransactionTemplate>

<property name="isolationLevelName" value="ISOLATION_READ_UNCOMMITTED"/>

<property name="timeout" value="30"/>

</bean>"

Fially, instances of the TransactionTemplate class are threadsafe, in that instaces do not maintain any conversational state.

Here also has an misspell "in that instaces do" => "in that instances do"

Chapter 12

12.2.4. Implementing Spring-based DAOs without callbacks's Example Code has some wrong code.

public class ProductDaoImpl extends HibernateDaoSupport implements ProductDao {

public Collection loadProductsByCategory(String category)
throws DataAccessException, MyException {

Session session = getSession(getSessionFactory(), false);
try {
List result = session.find(
"from test.Product product where product.category=?",
category, Hibernate.STRING);
if (result == null) {
throw new MyException("invalid search result");
}
return result;
}
catch (HibernateException ex) {
throw convertHibernateAccessException(ex);
}
}

}

HibernateDaoSupport doesn't have "getSession(SessionFactory sessionFactory, boolean allowCreate)" method.

And org.hibernate.Session doesn't have "find" method. and org.hibernate.classic.Session class was deprecated so fix the code like following code please.

Session session = getSession(false);

try {

List result = session.createQuery("from test.Product product where product.category=?").setString(0, category).list();

if (result == null) {

throw new MyException("invalid search result");

}

return result;

}

Sorry for my ugly English. :)

Affects: 2.0.4

Issue Links:

#8138 12.2.4 Hibernate documentation calls an unknown method ("is duplicated by")