parent
bede603fb3
commit
878f73158a
@ -129,7 +129,7 @@ Avoid empty try blocks - what's the point?
|
||||
<property name="xpath">
|
||||
<value>
|
||||
<![CDATA[
|
||||
//TryStatement/Block[1][count(*) = 0]
|
||||
//TryStatement[not(ResourceSpecification)]/Block[1][count(*) = 0]
|
||||
]]>
|
||||
</value>
|
||||
</property>
|
||||
|
@ -46,6 +46,19 @@ public class EmptyTryBlock3 {
|
||||
int x = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description>#432 false positive for empty try-with-resource</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
class X {
|
||||
void method() {
|
||||
try (ClientResponse response = execute(() -> target.request(mediaTypes).delete(), DELETE, new ExpectedResponse(status, required))) {
|
||||
// false positive
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
Loading…
x
Reference in New Issue
Block a user