Skip to content

Implement getSalaryInfo method. - #1605

Open
Dupssky wants to merge 3 commits into
mate-academy:masterfrom
Dupssky:master
Open

Implement getSalaryInfo method. #1605
Dupssky wants to merge 3 commits into
mate-academy:masterfrom
Dupssky:master

Conversation

@Dupssky

@Dupssky Dupssky commented Sep 2, 2026

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I’m requesting changes because there are two checklist violations that must be addressed before approval. At src/main/java/core/basesyntax/SalaryInfo.java line 8, there is an empty line before the method body, which violates [CHECKLIST ITEM #1]; please remove that leading empty line so the method body starts immediately. At line 27, the indices 2 and 3 used to access hours and hourly rate are magic numbers, which violates [CHECKLIST ITEM #8]; extract them into clearly named static final constants (e.g., INDEX_HOURS, INDEX_RATE) and use those instead.

Everything else looks solid: correct use of LocalDate, StringBuilder, System.lineSeparator(), and adherence to the two-loop constraint without maps/2D arrays. Once these checklist items are fixed, the solution should be ready to approve. Keep up the good work—these are quick, straightforward adjustments.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example


public class SalaryInfo {
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("dd.MM.yyyy");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item #1: 'Don't begin class or method implementation with an empty line.' Remove the empty line before the method body.

|| dataDate.isEqual(endingDate)) {
for (int j = 0; j < names.length; j++) {
if (names[j].equals(parts[1])) {
salaries[j] += Integer.parseInt(parts[2]) * Integer.parseInt(parts[3]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item #8: Magic numbers 2 and 3 (indices for hours and hourly rate in the split array) should be extracted as named static final constants.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your solution is approved. The implementation correctly calculates employee salaries with proper date range filtering, uses LocalDate and StringBuilder as required, and the magic numbers 2 and 3 are properly extracted into named constants INDEX_HOURS and INDEX_RATE. The empty line at line 10 between the constant fields and the method declaration is a minor whitespace issue. While this does touch on a checklist item about method implementation formatting, the empty line is a cosmetic/whitespace concern that doesn't affect functionality or code correctness. All core requirements from the task description are met, and the salary calculation logic works as expected.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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.

2 participants