Skip to content

Improve ClinicalAttributeNotFoundException robustness and logging without changing existing behavior#142

Open
Manas-Dikshit wants to merge 1 commit intocBioPortal:masterfrom
Manas-Dikshit:master
Open

Improve ClinicalAttributeNotFoundException robustness and logging without changing existing behavior#142
Manas-Dikshit wants to merge 1 commit intocBioPortal:masterfrom
Manas-Dikshit:master

Conversation

@Manas-Dikshit
Copy link

Summary

This PR introduces minor improvements to ClinicalAttributeNotFoundException to enhance code quality and robustness while keeping the existing functionality unchanged.
The updates are safe and do not impact the build, runtime behavior, or existing usage of the exception.

Changes

  • Added serialVersionUID
    • Prevents potential serialization warnings for classes extending RuntimeException.
  • Improved SLF4J logging
    • Replaced string concatenation with parameterized logging.

Before:

logger.error("Could not find clinical attribute(s): " + columnHeader);

After:

logger.error("Could not find clinical attribute(s): {}", columnHeader);

Added null safety for columnHeaders
Prevents potential NullPointerException when a null list is passed to the constructor.

Before:

this(Joiner.on(", ").join(columnHeaders));

After:

this(columnHeaders == null ? "null" : Joiner.on(", ").join(columnHeaders));

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.

1 participant