db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Incorrect code in NetworkDerbyControlImpl.shutdown()??
Date Mon, 16 Oct 2006 22:43:13 GMT
In NetworkDerbyControlImpl.shutdown() there is code that logs the 
message "DRDA_ShutdownError.S", which is:

Unable to shutdown server on port  {0} on host {1}.

The position of the code looks wrong, it is in a catch block for an 
exception with an if statement to check that the server has looped 

It seems that really the intention of the code would mean it should be 
logged outside the loop. See the following extracted code, it seems to 
me the code between the MOVE and END-MOVE comments should be moved to 
the end, where the TO-HERE comment is?


int ntry;
for (ntry = 0; ntry < SHUTDOWN_CHECK_ATTEMPTS; ntry++)
    try {
    } catch (Exception e)
      // as soon as we can't ping return
      // MOVE
      if (ntry == SHUTDOWN_CHECK_ATTEMPTS)
	consolePropertyMessage("DRDA_ShutdownError.S", new String [] {
		Integer.toString(portNumber), hostArg});
      // END-MOVE

View raw message