Skip to content

Conversation

@labkey-tchad
Copy link
Member

Rationale

A component found with refindWhenNeeded will automatically clear its cache after refinding. This can interfere with elementCache construction.

java.lang.NullPointerException: waitForReady() cleared the element cache
  at java.base/java.util.Objects.requireNonNull(Objects.java:235)
  at org.labkey.test.components.Component.elementCache(Component.java:76)
  at org.labkey.test.components.ui.notifications.ServerNotificationItem.getMessage(ServerNotificationItem.java:83)
  at org.labkey.test.tests.samplemanagement.samples.FMSampleFileImportTest.testCreateStorageWithLabels(FMSampleFileImportTest.java:2592)

If this requireNonNull gets triggered, waitForReady was successful or a component refind was successful. Either way, it should be safe to build a fresh element cache.

Related Pull Requests

Changes

  • Make Component.waitForReady cooperate with refinding components

@labkey-tchad labkey-tchad merged commit c73736f into develop Dec 18, 2025
8 checks passed
@labkey-tchad labkey-tchad deleted the fb_componentRefind branch December 18, 2025 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants