Skip to content

Conversation

Amitverma0509
Copy link

Pull Request Template

What does this PR do?

This PR fixes the broken logger reference and cleans up how the name field is accessed, making the code compile successfully and follow better coding standards without changing the program’s behavior.

This pull request fixes a compile-time error by replacing the incorrect LOGGER reference with the correct Lombok-generated log in App.java.
It also replaces direct access to servant.name with servant.getName() to follow proper encapsulation practices.
No functional behavior is changed — only logging and code quality are improved.

Explanation:
Updated snippet:

if (servant.checkIfYouWillBeHanged(guests)) {
  log.info("{} will live another day", servant.getName());
} else {
  log.info("Poor {}. His days are numbered", servant.getName());
}

LOGGER → log

Uses the correct Lombok-generated logger.
No extra logger setup required.
Code now compiles and runs.

servant.name → servant.getName()

Accesses the name using a getter method.
Respects encapsulation (object-oriented best practice).
Makes future refactoring easier if the field or logic changes.

Copy link

github-actions bot commented Oct 8, 2025

Analyzing changes in this PR...

This might take a few minutes, please wait

📥 Commits

Analyzing changes from base (ede37bd) to latest commit (cd2cbdc):

📁 Files being considered (1)

🔄 servant/src/main/java/com/iluwatar/servant/App.java (1 hunk)


autogenerated by presubmit.ai

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