Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: no return value
|
Posted: May 10, 2002 1:27 PM
|
|
Additionally, rather than silently exit() from a catch clause, you may as well not catch the exception and let it bubble up to the caller. (Yes, I realize this is probably testing-in-progress code and that you are the only one who will see it, but you'll be treating yourself better if you can see more of the exception information).
public SerialPort schnittstelleOeffnen(CommPortIdentifier comid) throws PortInUseException
{
return (SerialPort)comid.open("test", 100);
}
Of course, that would kind of obviate the need for your method, since you could just call the comid.open() method in the code that is currently calling schnittstelleOeffnen().
|
|