String to = msg.getTo();
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "Storing {0} message number {1} for sequence {2}, to = {3}",
new Object[] {outbound ? "outbound" : "inbound", nr, id, to});
}
<BUG>InputStream msgin = null;
try {</BUG>
msgin = msg.getInputStream();
<BUG>PreparedStatement stmt = outbound ? createOutboundMessageStmt : createInboundMessageStmt;
int i = 1;</BUG>
stmt.setString(i++, id);

String to = msg.getTo();
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "Storing {0} message number {1} for sequence {2}, to = {3}",
new Object[] {outbound ? "outbound" : "inbound", nr, id, to});
}
InputStream msgin = null;
PreparedStatement stmt = null;
try {
msgin = msg.getInputStream();
stmt = getStatement(con, outbound ? CREATE_OUTBOUND_MESSAGE_STMT_STR : CREATE_INBOUND_MESSAGE_STMT_STR);
int i = 1;
stmt.setString(i++, id);
