RFR: 8318324: Drop redundant default methods from FFM API
Jorn Vernee
jvernee at openjdk.org
Wed Oct 18 12:19:58 UTC 2023
On Wed, 18 Oct 2023 12:09:28 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/foreign/layout/AbstractLayout.java line 47:
>>
>>> 45: import java.util.Optional;
>>> 46: import java.util.Set;
>>> 47: import java.util.function.Function;
>>
>> There are quite a few new imports here. Is it possible some imports in `MemoryLayout` are now unused?
>
> No unused import here - these are just the imports required for the overrides to compile successfully.
I mean in `MemoryLayout` from which these overrides were moved.
>> src/java.base/share/classes/jdk/internal/foreign/layout/AbstractLayout.java line 153:
>>
>>> 151: }
>>> 152:
>>> 153: public long scale(long offset, long index) {
>>
>> Could you add `@Override` to these as well? I think it makes it clearer that these methods might be accessed through a super type.
>
> Would be nice - but note that `AbstractLayoutImpl` does not extend `MemoryLayout`.
Ah, right...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16224#discussion_r1363762975
PR Review Comment: https://git.openjdk.org/jdk/pull/16224#discussion_r1363762381
More information about the core-libs-dev
mailing list