Results for “java function return array example code site:bugs.java.com python”
bugs.java.com
Bug ID: JDK-8160406 Collection.toArray() spec should be explicit about...
Collection.toArray() is specified to return an object of type Object[], but since arrays are covariant, that requirement is met by any array of a subtype of Object, for example, String[]. It's subtle, but it's clearly, if not explicitly, a bug to return an array of a subtype. See JDK-6260652.
bugs.java.com
Bug ID: JDK-6294060 Use of substring() causes memory leak
This way it's nearly impossible to detect the memory leak. This behaviour is totally independent of OS, Java Version, VM type etc. It's an error in java.lang.String source code which is the same for all JDK distributions.