Add test case for #2534

This commit is contained in:
Juan Martín Sotuyo Dodero
2024-03-19 13:14:56 -03:00
parent 307598e602
commit 8df40cccf5

View File

@ -91,6 +91,21 @@ public class Test<E> {
// still returns an Object[] array type, and not E[].
return retVal;
}
}
]]></code>
</test-code>
<test-code>
<description>#2534 FN with toArray() called on a method call chain</description>
<expected-problems>1</expected-problems>
<expected-linenumbers>5</expected-linenumbers>
<code><![CDATA[
import java.util.Map;
public class Test {
public String[] extractKey(Map<String, String> data) {
return (String[]) data.keySet().toArray();
}
}
]]></code>
</test-code>