Menu

#38 Incoherent handling in PropertyHelper.java

open
nobody
None
5
2013-01-24
2005-02-28
No

i stumbled over strange code in
net.sourceforge.jpcap.util.PropertyHelper
in the load method, there is a call to System.exit,
which can have quite bad consequences in a library.

moreover, i do not see what the use of the exit might
be, as the result of an exception beeing thrown in that
method would result in returning null.

i'd propose 'return null' instead of System.exit.

additionally, your code works only for property files
inside the filesystem. why not also use
Class.getResource to get files out of a jar?

Discussion

  • Rodrigo

    Rodrigo - 2005-07-18

    Logged In: YES
    user_id=1151430

    It would be better to throw a "FileNotFoundException". That's
    the reason exceptions were created.

     
  • EJP

    EJP - 2008-08-20

    Logged In: YES
    user_id=1262793
    Originator: NO

    This is addressed in the forthcoming release 2.0.

     

Log in to post a comment.

MongoDB Logo MongoDB