Add failing test case for #1903

This commit is contained in:
Juan Martín Sotuyo Dodero
2019-07-18 19:34:51 -03:00
parent 266d6bb453
commit ca34d4fa1c

View File

@ -258,6 +258,24 @@ public class Foo {
sdf.format();
}
}
}
]]></code>
</test-code>
<test-code>
<description>#1903 - Block synch is valid even with allowMethodLevelSynchronization</description>
<rule-property name="allowMethodLevelSynchronization">true</rule-property>
<expected-problems>0</expected-problems>
<code><![CDATA[
import java.text.SimpleDateFormat;
public class Foo {
private static final SimpleDateFormat sdf = new SimpleDateFormat();
private void bar() {
synchronized(sdf) {
sdf.format();
}
}
}
]]></code>
</test-code>