Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v8]

2022-05-31 Thread Roger Riggs
On Tue, 31 May 2022 19:30:07 GMT, Сергей Цыпанов  wrote:

>> `List.of()` along with `Set.of()` create unmodifiable `List/Set` but with 
>> smaller footprint comparing to `Arrays.asList()` / `new HashSet()` when 
>> called with vararg of size 0, 1, 2.
>> 
>> In general replacement of `Arrays.asList()` with `List.of()` is dubious as 
>> the latter is null-hostile, however in some cases we are sure that arguments 
>> are non-null. Into this PR I've included the following cases (in addition to 
>> those where the argument is proved to be non-null at compile-time):
>> - `MethodHandles.longestParameterList()` never returns null
>> - parameter types are never null
>> - interfaces used for proxy construction and returned from 
>> `Class.getInterfaces()` are never null
>> - exceptions types of method signature are never null
>
> Сергей Цыпанов has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains six commits:
> 
>  - 8282662: Revert wrong copyright year change
>  - 8282662: Revert ProxyGenerator
>  - 8282662: Revert ProxyGenerator
>  - 8282662: Revert dubious changes in MethodType
>  - 8282662: Revert dubious changes
>  - 8282662: Use List/Set.of() factory methods to save memory

Merging is preferable, it doesn't disturb the history.
Usually an explicit merge is not necessary; Skara will indicate when an 
automatic merge is needed due to conflicts.
If you want to run your own tests then use a merge, not rebase.
Thanks

-

PR: https://git.openjdk.java.net/jdk/pull/7729


Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v8]

2022-05-31 Thread Сергей Цыпанов
On Tue, 31 May 2022 19:33:15 GMT, Roger Riggs  wrote:

>> Сергей Цыпанов has updated the pull request with a new target base due to a 
>> merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains six additional 
>> commits since the last revision:
>> 
>>  - 8282662: Revert wrong copyright year change
>>  - 8282662: Revert ProxyGenerator
>>  - 8282662: Revert ProxyGenerator
>>  - 8282662: Revert dubious changes in MethodType
>>  - 8282662: Revert dubious changes
>>  - 8282662: Use List/Set.of() factory methods to save memory
>
> Why the force push?  They are discouraged, making it harder to review.

@RogerRiggs I've rebased my changes onto master to incorporate the latest 
changes.

-

PR: https://git.openjdk.java.net/jdk/pull/7729


Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v8]

2022-05-31 Thread Roger Riggs
On Tue, 31 May 2022 19:30:07 GMT, Сергей Цыпанов  wrote:

>> `List.of()` along with `Set.of()` create unmodifiable `List/Set` but with 
>> smaller footprint comparing to `Arrays.asList()` / `new HashSet()` when 
>> called with vararg of size 0, 1, 2.
>> 
>> In general replacement of `Arrays.asList()` with `List.of()` is dubious as 
>> the latter is null-hostile, however in some cases we are sure that arguments 
>> are non-null. Into this PR I've included the following cases (in addition to 
>> those where the argument is proved to be non-null at compile-time):
>> - `MethodHandles.longestParameterList()` never returns null
>> - parameter types are never null
>> - interfaces used for proxy construction and returned from 
>> `Class.getInterfaces()` are never null
>> - exceptions types of method signature are never null
>
> Сергей Цыпанов has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains six commits:
> 
>  - 8282662: Revert wrong copyright year change
>  - 8282662: Revert ProxyGenerator
>  - 8282662: Revert ProxyGenerator
>  - 8282662: Revert dubious changes in MethodType
>  - 8282662: Revert dubious changes
>  - 8282662: Use List/Set.of() factory methods to save memory

Why the force push?  They are discouraged, making it harder to review.

-

PR: https://git.openjdk.java.net/jdk/pull/7729


Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v8]

2022-05-31 Thread Сергей Цыпанов
> `List.of()` along with `Set.of()` create unmodifiable `List/Set` but with 
> smaller footprint comparing to `Arrays.asList()` / `new HashSet()` when 
> called with vararg of size 0, 1, 2.
> 
> In general replacement of `Arrays.asList()` with `List.of()` is dubious as 
> the latter is null-hostile, however in some cases we are sure that arguments 
> are non-null. Into this PR I've included the following cases (in addition to 
> those where the argument is proved to be non-null at compile-time):
> - `MethodHandles.longestParameterList()` never returns null
> - parameter types are never null
> - interfaces used for proxy construction and returned from 
> `Class.getInterfaces()` are never null
> - exceptions types of method signature are never null

Сергей Цыпанов has updated the pull request with a new target base due to a 
merge or a rebase. The pull request now contains six commits:

 - 8282662: Revert wrong copyright year change
 - 8282662: Revert ProxyGenerator
 - 8282662: Revert ProxyGenerator
 - 8282662: Revert dubious changes in MethodType
 - 8282662: Revert dubious changes
 - 8282662: Use List/Set.of() factory methods to save memory

-

Changes: https://git.openjdk.java.net/jdk/pull/7729/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=7729=07
  Stats: 13 lines in 5 files changed: 1 ins; 2 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7729.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7729/head:pull/7729

PR: https://git.openjdk.java.net/jdk/pull/7729