Skip to content

Commit d46a82b

Browse files
committed
Added note on thread safety to TypeConverter and SimpleTypeConverter javadoc
Issue: SPR-8659
1 parent 7f928e8 commit d46a82b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/SimpleTypeConverter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,9 @@
2323
* algorithm (including delegation to {@link java.beans.PropertyEditor} and
2424
* {@link org.springframework.core.convert.ConversionService}) underneath.
2525
*
26+
* <p><b>Note:</b> Due to its reliance on {@link java.beans.PropertyEditor PropertyEditors},
27+
* SimpleTypeConverter is <em>not</em> thread-safe. Use a separate instance for each thread.
28+
*
2629
* @author Juergen Hoeller
2730
* @since 2.0
2831
* @see BeanWrapperImpl

spring-beans/src/main/java/org/springframework/beans/TypeConverter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,6 +24,10 @@
2424
* Interface that defines type conversion methods. Typically (but not necessarily)
2525
* implemented in conjunction with the {@link PropertyEditorRegistry} interface.
2626
*
27+
* <p><b>Note:</b> Since TypeConverter implementations are typically based on
28+
* {@link java.beans.PropertyEditor PropertyEditors} which aren't thread-safe,
29+
* TypeConverters themselves are <em>not</em> to be considered as thread-safe either.
30+
*
2731
* @author Juergen Hoeller
2832
* @since 2.0
2933
* @see SimpleTypeConverter

0 commit comments

Comments
 (0)