Skip to content

Rename ThreadLocalDataStorage to improve readability #905

Open

Description

@holgpar

Context

ThreadLocalDataStorage is used to signal that a draft activation is in progress, so that CreateAttachmentsHandler and UpdateAttachmentsHandler know to preserve readonly fields.

The current API is:

threadLocalSetter.set(true, context::proceed);  // set flag
threadLocalSetter.get();                         // read flag

The boolean true and generic method names carry no semantic meaning at the call site.

Proposed Change

Rename the class to ActivationContext (or similar) and the methods to:

ActivationContext.markAsDraftActivation(context::proceed);  // set flag
ActivationContext.isDraftActivation();                       // read flag

This makes the intent clear without needing to read the implementation.

Scope

  • Rename ThreadLocalDataStorage, ThreadDataStorageSetter, ThreadDataStorageReader
  • Update all usages in handlers and Registration
  • Update test classes accordingly

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions