If your class use a close method different to "close", it doesn't get recognized.
Sample test case, it should run without errors:
<test-code>
<description><![CDATA[Custom close method, should be ok]]></description>
<rule-property name="closeTargets">cleanup</rule-property>
<rule-property name="types">MyClass</rule-property>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
void bar() {
MyClass myClass = new MyClass();
try {
} catch (Exception e) {
} finally {
myClass.cleanup(); // should be ok, it's closed with cleanup
}
}
}
]]></code>
</test-code>
I've attacched a patch, it's not complete because it breaks another test, but I think the other test is already broken (It fires becaus this bug, not because the testcase intended to check)