For my production code resembling the following:
public something xyz(String name) {
return getSomething(abc.get(name));
}
Where the method "get" expects javax.management.ObjectName to be passed to it, I am getting the following high priority warning from the Findbugs tool:
Bug: String is incompatible with expected argument type javax.management.ObjectName
Pattern id: GC_UNRELATED_TYPES, type: GC, category: CORRECTNESS
However, according to javax API docs, I see that one can have ObjectName as a String, as shown on: http://download.oracle.com/javase/6/docs/api/javax/management/ObjectName.html
Is this a problem with Findbugs or am I missing something?
public something xyz(String name) {
return getSomething(abc.get(new ObjectName(name)));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With