Skip to content

The second multithreading task#2

Open
ppapou wants to merge 2 commits into
developfrom
task/file_scanner
Open

The second multithreading task#2
ppapou wants to merge 2 commits into
developfrom
task/file_scanner

Conversation

@ppapou

@ppapou ppapou commented Aug 10, 2023

Copy link
Copy Markdown
Owner
  • file scanner has added

@oleksandr-ilin oleksandr-ilin 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.

generally it is good
But have just few minor recommendations. See my review comments.

/**
* Current processed file
*/
protected final File mFile;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do you define the members as protected
Also I would recommend to avoid Hungarian notation in Java.
Also that is bad practice according to Clean Code principles.
Instead try to give is a good and meaningful name consists from normal English words.

* Directories count
*/
protected final AtomicLong mFolderCount;
FileCounterTask(File file, AtomicLong mDocumentCount, AtomicLong mFolderCount) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why the constructor has package visibility?
How would you like to use this class?

}

@Override
protected Long compute() {

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 method deserve to be split up on smaller logical chunks. So you can clearly see the logical structure.

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