PMD rule AvoidSynchronizedAtMethodLevel is activated. Issue #744
This commit is contained in:
parent
6b58e1c7fd
commit
18ed7958cf
|
|
@ -113,7 +113,6 @@
|
|||
<exclude name="ConfusingTernary"/>
|
||||
<!-- extra final modifier does not make code more secure in that cases-->
|
||||
<exclude name="ImmutableField"/>
|
||||
<exclude name="AvoidSynchronizedAtMethodLevel"/>
|
||||
<exclude name="MissingBreakInSwitch"/>
|
||||
<exclude name="UseNotifyAllInsteadOfNotify"/>
|
||||
<exclude name="AvoidInstanceofChecksInCatchClause"/>
|
||||
|
|
|
|||
|
|
@ -138,14 +138,16 @@ public class UniquePropertiesCheck extends AbstractFileSetCheck
|
|||
.create();
|
||||
|
||||
@Override
|
||||
public synchronized Object put(Object key, Object value)
|
||||
public Object put(Object key, Object value)
|
||||
{
|
||||
final Object oldValue = super.put(key, value);
|
||||
if (oldValue != null && key instanceof String) {
|
||||
final String keyString = (String) key;
|
||||
duplicatedStrings.add(keyString);
|
||||
synchronized (this) {
|
||||
final Object oldValue = super.put(key, value);
|
||||
if (oldValue != null && key instanceof String) {
|
||||
final String keyString = (String) key;
|
||||
duplicatedStrings.add(keyString);
|
||||
}
|
||||
return oldValue;
|
||||
}
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
public Multiset<String> getDuplicatedStrings()
|
||||
|
|
|
|||
Loading…
Reference in New Issue