Skip to content

GH-1703 - Simplify JPA publication status defaulting#1704

Open
char-yb wants to merge 1 commit into
spring-projects:mainfrom
char-yb:refactor/gh-1703-simplify-jpa-publication-status-default
Open

GH-1703 - Simplify JPA publication status defaulting#1704
char-yb wants to merge 1 commit into
spring-projects:mainfrom
char-yb:refactor/gh-1703-simplify-jpa-publication-status-default

Conversation

@char-yb
Copy link
Copy Markdown

@char-yb char-yb commented May 20, 2026

Summary

  • Simplify the default status assignment in JpaEventPublication.
  • Remove an unreachable completionDate check from the constructor.

Details

JpaEventPublication previously initialized status with:

this.status = status != null ? status : completionDate != null ? Status.COMPLETED : Status.PROCESSING;

However, completionDate is an instance field, not a constructor parameter. During constructor execution it still has its default value, null, so the Status.COMPLETED branch is not reachable from this expression.

This change keeps the effective behavior and makes the defaulting logic explicit:

this.status = status != null ? status : Status.PROCESSING;

Remove an unreachable completionDate check from the constructor's

default status assignment.

Signed-off-by: char-yb <uiurihappy@naver.com>
@char-yb char-yb changed the title Simplify JPA publication status defaulting GH-1703 - Simplify JPA publication status defaulting May 20, 2026
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