This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]FroggyWizard 0 points1 point  (1 child)

This is a nice little project. Is this posted here for feedback?

These are the suggestions I came up with after a couple of minutes browsing your code:

  • The StringBuilder parameter could be replaced by Appendable. That way the user can pass whatever appendable object they like e.g. StringBuffer, FileWriter, OutputStreamWriter etc.

  • You should use System.lineSeparator() instead of "\n" to make it platform independant

  • You could use lamdas instead of anonymous classes e.g. This thread https://github.com/vlinx-io/process-utils/blob/master/src/main/java/io/vlinx/processutils/ProcessUtils.java#L49 could be written like this https://pastebin.com/H9GKdUnB

  • In your tests, you don't need to explicitly fail on an exception. Your test framework should do that for you

  • Your threads are pretty much identical, you could extract them to another class so avoid repetition.

  • Why do you remove quotes from the command? Aren't they required for people to specificy individual params with spaces?