AsciidocFX icon indicating copy to clipboard operation
AsciidocFX copied to clipboard

Code quality - drop while(true)

Open Ayowel opened this issue 4 years ago • 1 comments
trafficstars

Fix #524 and added comments on the loops where a while(true) seemed legitimate to justify them.

Note that:

  • The file watcher now resets right after polling to avoid useless consecutive calls
  • In FileBrowseServiceImpl.searchDownAndSelect, I replaced the use of previous by next in if (Objects.isNull(searchFoundItem)) as I could not make sense of the code the way it was.

Other than that, old and new code should be strictly equivalent

Ayowel avatar Jul 18 '21 00:07 Ayowel

Updated the while loop to a for in DirectoryServiceImpl as it is more accurate to what the code does.

Also removed the class' constructor as well as some attributes that were not used. Dropped a lambda instantiation as the raw value it returned could be used instead and avoided the use of a stream to create a list where the list could directly be instantiated instead.

Ayowel avatar Jul 19 '21 21:07 Ayowel