On Fri, 18 Sep 2026 12:25:27 GMT, Jorn Vernee <[email protected]> wrote:

>> src/jdk.jartool/share/classes/sun/tools/jar/FingerPrint.java line 184:
>> 
>>> 182:                 cm.thisClass().asInternalName(),
>>> 183:                 
>>> cm.superclass().map(ClassEntry::asInternalName).orElse(null),
>>> 184:                 
>>> cm.interfaces().stream().map(ClassEntry::asInternalName).collect(Collectors.toSet()),
>> 
>> I think we can require the interfaces to be in the same order given we are 
>> already strict. Using a List also makes the other parts of tracking simpler.
>
> How would it simplify other tracking? Only this line has to convert to a set 
> instead of a list?
> 
> I think I'd rather keep this using a set. `ClassModel::interface` doesn't 
> specify the order in which the interfaces appear in the list. Also, even if 
> it's guaranteed to match the class file, I suppose javac will output 
> interfaces in a deterministic order, but other compilers may not. Any 
> incidental change in order would trigger an error.

Note that the order of interfaces influences which abstract `Method` gets 
selected by reflection when the same signature is present in disjoint interface 
hierarchies.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/32787#discussion_r4049329406

Reply via email to