Re: RFR: 8199318: add idempotent copy operation for Map.Entry [v2]

2021-06-03 Thread Daniel Fuchs
On Wed, 2 Jun 2021 17:54:06 GMT, Stuart Marks  wrote:

>> I'm fixing this along with a couple intertwined issues.
>> 
>> 1. Add Map.Entry::copyOf as an idempotent copy operation.
>> 
>> 2. Clarify that AbstractMap.SimpleImmutableEntry is itself unmodifiable (not 
>> really immutable) but that subclasses can be modifiable.
>> 
>> 3. Clarify some confusing, historical wording about Map.Entry instances 
>> being obtainable only via iteration of a Map's entry-set view. This was 
>> never really true, since anyone could implement the Map.Entry interface, and 
>> it certainly was not true since JDK 1.6 when SimpleEntry and 
>> SimpleImmutableEntry were added.
>
> Stuart Marks has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Tiny editorial tweaks.

Marked as reviewed by dfuchs (Reviewer).

-

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


Re: RFR: 8199318: add idempotent copy operation for Map.Entry [v2]

2021-06-02 Thread Stuart Marks
On Wed, 2 Jun 2021 18:07:55 GMT, Daniel Fuchs  wrote:

>> Stuart Marks has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Tiny editorial tweaks.
>
> src/java.base/share/classes/java/util/Map.java line 396:
> 
>> 394: 
>> 395: /**
>> 396:  * A map entry (key-value pair). The Entry may be unmodifiable, or 
>> the
> 
> In that case then maybe it should be `{@code Entry}` in both places where 
> `entry` was replaced with `Entry` ?

Maybe. We're not terribly consistent about this. A fair amount of the docs just 
uses a plain-text, capitalized form of a class name, as opposed to the code 
font. Using the code font everywhere adds clutter to both the markup and to the 
rendered output. In this case I wanted to distinguish the generic mention of an 
entry in a map from an instance of an Entry object. In cases where it needs to 
be absolutely clear, I used `Map.Entry` (the qualified name, in code font). 
Doing that here seems like it would add too much clutter though.

-

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


Re: RFR: 8199318: add idempotent copy operation for Map.Entry [v2]

2021-06-02 Thread Paul Sandoz
On Wed, 2 Jun 2021 17:54:06 GMT, Stuart Marks  wrote:

>> I'm fixing this along with a couple intertwined issues.
>> 
>> 1. Add Map.Entry::copyOf as an idempotent copy operation.
>> 
>> 2. Clarify that AbstractMap.SimpleImmutableEntry is itself unmodifiable (not 
>> really immutable) but that subclasses can be modifiable.
>> 
>> 3. Clarify some confusing, historical wording about Map.Entry instances 
>> being obtainable only via iteration of a Map's entry-set view. This was 
>> never really true, since anyone could implement the Map.Entry interface, and 
>> it certainly was not true since JDK 1.6 when SimpleEntry and 
>> SimpleImmutableEntry were added.
>
> Stuart Marks has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Tiny editorial tweaks.

Marked as reviewed by psandoz (Reviewer).

-

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


Re: RFR: 8199318: add idempotent copy operation for Map.Entry [v2]

2021-06-02 Thread Daniel Fuchs
On Wed, 2 Jun 2021 17:54:06 GMT, Stuart Marks  wrote:

>> I'm fixing this along with a couple intertwined issues.
>> 
>> 1. Add Map.Entry::copyOf as an idempotent copy operation.
>> 
>> 2. Clarify that AbstractMap.SimpleImmutableEntry is itself unmodifiable (not 
>> really immutable) but that subclasses can be modifiable.
>> 
>> 3. Clarify some confusing, historical wording about Map.Entry instances 
>> being obtainable only via iteration of a Map's entry-set view. This was 
>> never really true, since anyone could implement the Map.Entry interface, and 
>> it certainly was not true since JDK 1.6 when SimpleEntry and 
>> SimpleImmutableEntry were added.
>
> Stuart Marks has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Tiny editorial tweaks.

src/java.base/share/classes/java/util/Map.java line 396:

> 394: 
> 395: /**
> 396:  * A map entry (key-value pair). The Entry may be unmodifiable, or 
> the

In that case then maybe it should be `{@code Entry}` in both places where 
`entry` was replaced with `Entry` ?

-

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


Re: RFR: 8199318: add idempotent copy operation for Map.Entry [v2]

2021-06-02 Thread Stuart Marks
> I'm fixing this along with a couple intertwined issues.
> 
> 1. Add Map.Entry::copyOf as an idempotent copy operation.
> 
> 2. Clarify that AbstractMap.SimpleImmutableEntry is itself unmodifiable (not 
> really immutable) but that subclasses can be modifiable.
> 
> 3. Clarify some confusing, historical wording about Map.Entry instances being 
> obtainable only via iteration of a Map's entry-set view. This was never 
> really true, since anyone could implement the Map.Entry interface, and it 
> certainly was not true since JDK 1.6 when SimpleEntry and 
> SimpleImmutableEntry were added.

Stuart Marks has updated the pull request incrementally with one additional 
commit since the last revision:

  Tiny editorial tweaks.

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4295/files
  - new: https://git.openjdk.java.net/jdk/pull/4295/files/841a154c..c67b6445

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=4295=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=4295=00-01

  Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4295.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4295/head:pull/4295

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