CPScanner.findRoots prints stack dumps to stdout for ignored exceptions.
Java Classpath Scanner
Brought to you by:
sdir
Seeing stack dumps in the console makes people worry and can confuse debugging for other problems. It would be better if this didn't happen for exceptions that are not truly errors.
There are 2 cases I've seen of this so far in version 1.1.10:
There may be others I haven't encountered yet...
Absolutely this puts a lot of unwanted noise in the logs. The problem is that they don't rely on any logger library (sl4j, etc.) so they just puke the stack trace at line 160, and that these ones are probably not real errors. The CPScanner should provide a mechanism to deal with the errors, such as to configure a callback, or to override a log method. For instance (untested) :
and :
Thus a programmer who doesn't care and who wants to keep his logs tidy would just have to subclass CPScanner and provide for a cleaner logException method. Additionnaly, the library should define its own specialized exceptions so that one can let go missing manifests but still react to an unexpected problems.
Remark: at 2nd reading I see that all the methods are static (why???) thus the simple override system will not work...
Last edit: michel 2017-11-18