Added note on thread safety to TypeConverter and SimpleTypeConverter javadoc

Issue: SPR-8659
This commit is contained in:
Juergen Hoeller 2013-01-24 11:19:06 +01:00
parent 7f928e83ff
commit d46a82bbb0
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2013 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,6 +23,9 @@ package org.springframework.beans;
* algorithm (including delegation to {@link java.beans.PropertyEditor} and * algorithm (including delegation to {@link java.beans.PropertyEditor} and
* {@link org.springframework.core.convert.ConversionService}) underneath. * {@link org.springframework.core.convert.ConversionService}) underneath.
* *
* <p><b>Note:</b> Due to its reliance on {@link java.beans.PropertyEditor PropertyEditors},
* SimpleTypeConverter is <em>not</em> thread-safe. Use a separate instance for each thread.
*
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
* @see BeanWrapperImpl * @see BeanWrapperImpl

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2013 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,6 +24,10 @@ import org.springframework.core.MethodParameter;
* Interface that defines type conversion methods. Typically (but not necessarily) * Interface that defines type conversion methods. Typically (but not necessarily)
* implemented in conjunction with the {@link PropertyEditorRegistry} interface. * implemented in conjunction with the {@link PropertyEditorRegistry} interface.
* *
* <p><b>Note:</b> Since TypeConverter implementations are typically based on
* {@link java.beans.PropertyEditor PropertyEditors} which aren't thread-safe,
* TypeConverters themselves are <em>not</em> to be considered as thread-safe either.
*
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
* @see SimpleTypeConverter * @see SimpleTypeConverter