On Mon, 20 May 2024 08:20:11 GMT, Alexander Zuev <kiz...@openjdk.org> wrote:

>> Caching children and selected children of the thee on the native level;
>> Caching all children of a specific parent in CAccessibility to enhance 
>> recursive children selection algorithm;
>> Removing fix for JDK-8317771 as no longer needed;
>
> Alexander Zuev has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   - Remove unused import;

src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/OutlineAccessibility.m 
line 70:

> 68: - (nullable  NSArray<id<NSAccessibilityRow>> *)accessibilityChildren
> 69: {
> 70:     if (![self isCacheValid]) {

Why can't we use `rowCacheValid` value to check like it is done for 
`accessibilitySelectedChildren` method?

src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/OutlineAccessibility.m 
line 98:

> 96: - (BOOL)isCacheValid
> 97: {
> 98:     if (rowCacheValid && [[self parent] 
> respondsToSelector:NSSelectorFromString(@"isCacheValid")]) {

When `isCacheValid` is invoked for the first time then `rowCacheValid` is 
_FALSE_ and we return _FALSE_ value from this method and then the 
`accessibilityChildren` method from super class is invoked to get all children 
and store them in an array(`rowCache`). Subsequently `rowCacheValid` will be 
set to _TRUE_.

As per my understanding `[[self parent] 
respondsToSelector:NSSelectorFromString(@"isCacheValid")]` condition will be 
checked only if `rowCacheValid` is true and once we have a valid array of 
children then what is the point of checking `isCacheValid` method in parent ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19255#discussion_r1607904605
PR Review Comment: https://git.openjdk.org/jdk/pull/19255#discussion_r1607902555

Reply via email to