[GitHub] kinow commented on issue #66: Avoid Code Duplication: Reuse Sleep from ThreadMonitor

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] kinow commented on issue #66: Avoid Code Duplication: Reuse Sleep from ThreadMonitor

GitBox
kinow commented on issue #66: Avoid Code Duplication: Reuse Sleep from ThreadMonitor
URL: https://github.com/apache/commons-io/pull/66#issuecomment-464305120
 
 
   Hi @DaGeRe !
   
   Agree that code duplication is bad. But the change could perhaps be changed a little bit to make it easier to accept it in my opinion.
   
   In `ThreadMonitor`, when you make it public, it also means that we are telling users that they are free to use this class in their code as well. Instead of it being hidden in the package level (which doesn't necessarily stops them, but discourages and at least raises the question of whether they should use it).
   
   But I agree with the remaining changes (except by one incorrect indentation that may raise a checkstyle issue).
   
   Would you like to try, perhaps, creating a test class in the same package, but under the test sources? That way you can either wrap or extend the origin `ThreadMonitor` and still remove the duplication in the `sleep` method. Also making it easier for us to maintain the code :-)
   
   Cheers
   Bruno

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]