On Fri, 31 May 2024 18:39:33 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but many Methods have zero exceptions or zero
>> parameters, and
On Fri, 31 May 2024 18:39:33 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but many Methods have zero exceptions or zero
>> parameters, and
On Fri, 31 May 2024 18:39:33 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but many Methods have zero exceptions or zero
>> parameters, and
On Fri, 31 May 2024 18:39:33 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but many Methods have zero exceptions or zero
>> parameters, and
On Fri, 31 May 2024 17:59:18 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but many Methods have zero exceptions or zero
>> parameters, and
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but many Methods have zero exceptions or zero
> parameters, and returning the original `Class[0]` is sufficient.
>
> R
On Fri, 31 May 2024 17:59:18 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but many Methods have zero exceptions or zero
>> parameters, and
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but many Methods have zero exceptions or zero
> parameters, and returning the original `Class[0]` is sufficient.
>
> R
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but many Methods have zero exceptions or zero
> parameters, and returning the original `Class[0]` is sufficient.
>
> R
On Fri, 31 May 2024 16:53:36 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but many Methods have zero exceptions or zero
>> parameters, and
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but smany Methods have zero exceptions or zero
> parameters, and returning the original `Class[0]` is sufficient.
jeng
On Fri, 31 May 2024 16:21:36 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but smany Methods have zero exceptions or zero
>> parameters, and
On Wed, 22 May 2024 09:44:18 GMT, Aleksey Shipilev wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but smany Methods have zero exceptions or zero
>> parame
On Fri, 31 May 2024 16:18:01 GMT, jengebr wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but smany Methods have zero exceptions or zero
>> parameters, and
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but smany Methods have zero exceptions or zero
> parameters, and returning the original `Class[0]` is sufficient.
jeng
On Tue, 21 May 2024 13:49:18 GMT, jengebr wrote:
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but smany Methods have zero exceptions or zero
> parameters, and ret
On Tue, 21 May 2024 13:49:18 GMT, jengebr wrote:
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but smany Methods have zero exceptions or zero
> parameters, and ret
On Tue, 21 May 2024 13:49:18 GMT, jengebr wrote:
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but smany Methods have zero exceptions or zero
> parameters, and ret
On Wed, 22 May 2024 14:32:23 GMT, Chen Liang wrote:
>> Thanks. Unfortunately the variable `cloneArray` is actually a method
>> parameter, and most of the callers pass in `false` - so using this utility
>> method to control cloning would actually introduce cloning in several places
>> where it
On Wed, 22 May 2024 14:33:31 GMT, Aleksey Shipilev wrote:
>> Why can't you do something like this:
>>
>> return cloneArray ? ReflectionFactory.copyClasses(interfaces) : interfaces;
>>
>>
>> Alternatively, your proposal is a good one too; we can rename this
>> `getInterfaces(boolean)` to `getI
On Wed, 22 May 2024 09:39:50 GMT, Aleksey Shipilev wrote:
>> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
>> Class[0] instances. This cloning is intended to prevent callers from
>> changing array contents, but smany Methods have zero exceptions or zero
>> parame
On Wed, 22 May 2024 13:44:59 GMT, Chen Liang wrote:
>> @liach I see such an opportunity in `Proxy.getProxyConstructor`, is that
>> what you have in mind?
>
> No, I mean here:
> https://github.com/openjdk/jdk/blob/4f1a10f84bcfadef263a0890b6834ccd3d5bb52f/src/java.base/share/classes/java/lang/Cla
On Wed, 22 May 2024 12:58:40 GMT, jengebr wrote:
>> Can't this be used by class cloning interfaces too?
>
> @liach I see such an opportunity in `Proxy.getProxyConstructor`, is that what
> you have in mind?
No, I mean here:
https://github.com/openjdk/jdk/blob/4f1a10f84bcfadef263a0890b6834ccd3d5
On Thu, 23 May 2024 09:05:09 GMT, Aleksey Shipilev wrote:
>> Alternatively, if a utility method is overkill, we can inline these to
>> `Executable`:
>>
>> public Class[] getParameterTypes() {
>> var shared = getSharedParameterTypes();
>> return shared.length == 0 ? shared : shared.clone
On Wed, 22 May 2024 19:48:49 GMT, Chen Liang wrote:
>> I really see no reason to try and save on re-use of this one-line method for
>> _everything_. In fact, I do not quite see a very compelling reason to even
>> have the utility method. Sharing the code between `Method` and `Constructor`
>> i
On Wed, 22 May 2024 14:24:40 GMT, jengebr wrote:
>> No, I mean here:
>> https://github.com/openjdk/jdk/blob/4f1a10f84bcfadef263a0890b6834ccd3d5bb52f/src/java.base/share/classes/java/lang/Class.java#L1329
>>
>> (That's also why I suggest putting the utiltiy method in ReflectionFactory
>> instea
On Wed, 22 May 2024 10:27:16 GMT, Chen Liang wrote:
>> src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java line
>> 249:
>>
>>> 247: * the original can safely be reused.
>>> 248: */
>>> 249: public Class[] copyClasses(Class[] classes) {
>>
>> There is no need t
On Fri, 24 May 2024 21:59:58 GMT, Chen Liang wrote:
> Can you update the ending copyright years from 2023 to 2024 on the 2nd line
> of the 2 modified files?
Done, thank you.
-
PR Comment: https://git.openjdk.org/jdk/pull/19327#issuecomment-2135215681
On Wed, 22 May 2024 09:44:18 GMT, Aleksey Shipilev wrote:
> Please also enable GHA testing: https://github.com/jengebr/jdk/actions. You
> may need to trigger the test run manually after this, since the PR hook have
> already missed it. Go to "OpenJDK Sanity Checks" on the left on that page,
>
On Tue, 21 May 2024 13:49:18 GMT, jengebr wrote:
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but smany Methods have zero exceptions or zero
> parameters, and ret
On Tue, 21 May 2024 14:07:29 GMT, jengebr wrote:
> Any suggestions?
I would recommend a new method `copyClasses`/`copyTypes` in
`jdk.internal.reflect.ReflectionFactory`, as it already has related
`copyConstructor` and `getExecutableSharedParameterTypes` methods.
Also, can you rename your PR's
On Tue, 21 May 2024 13:49:18 GMT, jengebr wrote:
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but smany Methods have zero exceptions or zero
> parameters, and ret
Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
Class[0] instances. This cloning is intended to prevent callers from changing
array contents, but smany Methods have zero exceptions or zero parameters, and
returning the original `Class[0]` is sufficient.
On Tue, 21 May 2024 13:49:18 GMT, jengebr wrote:
> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of
> Class[0] instances. This cloning is intended to prevent callers from
> changing array contents, but smany Methods have zero exceptions or zero
> parameters, and ret
34 matches
Mail list logo