Re: [PATCH] Enhancement proposal for usage of Method::getParameterTypes

2019-11-13 Thread Сергей Цыпанов
Hello, thanks for quick review! Tagir Valeev from JetBrains comes with suggestion to improve compiler optimizations here https://youtrack.jetbrains.com/issue/IDEA-226474. Rationale: in fact the cloned array could be a subject of allocation erasure as any property dereferenced from it can be de

Re: [PATCH] Enhancement proposal for usage of Method::getParameterTypes

2019-11-08 Thread Claes Redestad
Hi, some or all of these were pointed out as part of https://bugs.openjdk.java.net/browse/JDK-8029019 There was a patch out for review early 2017. I'm not sure what happened to that? Either way I think it might make sense to get this small and trivial enhancement separated out and fixed. Thank

[PATCH] Enhancement proposal for usage of Method::getParameterTypes

2019-11-08 Thread Сергей Цыпанов
Hello, it seems like Method.getParameterTypes() is often misused in JDK (and beyond): array returned from the method is used only to acquire number of method params by retrieving array.length. The problem here is that Method.getPatameterTypes() clones underlying array and returns the copy. Inst