- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of
this repository and believe that this is not a duplicate.
- [x] I have checked the
[FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository
and believe that this is not a duplicate.
### Environment
* Dubbo version: 2.7.6-SNAPSHOT
``` java
synchronized (parameterClassName.intern()) {
CtClass ctClass = null;
try {
```
https://github.com/apache/dubbo/blob/master/dubbo-filter/dubbo-filter-validation/src/main/java/org/apache/dubbo/validation/support/jvalidation/JValidator.java#L135
> Code should not synchronize on a variable or field of a boxed type (for
> example Integer, Boolean) or of type String since it is likely to contain an
> object that is used throughout the program. For example, Boolean.TRUE holds a
> single instance that will be used in many places throughout the program:
> whenever true is autoboxed or a call to Boolean.valueOf is made with true as
> an argument the same instance of Boolean is returned. It is therefore likely
> that two classes synchronizing on a field of type Boolean will end up
> synchronizing on the same object. This may lead to deadlock or threads being
> blocked unnecessarily.
### References
https://wiki.sei.cmu.edu/confluence/display/java/LCK01-J.+Do+not+synchronize+on+objects+that+may+be+reused
https://cwe.mitre.org/data/definitions/662.html
[ Full content available at: https://github.com/apache/dubbo/issues/5564 ]
This message was relayed via gitbox.apache.org for
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]