It would be good to specify the behavior of javax.sql.StatementEvent, javax.sql.ConnectionEvent, javax.sql.RowSetEvent constructors if first given param is null. For example, the spec says nothing about the null param value for javax.sql.StatementEvent:
------------------------------------------------------------------------------------------
public StatementEvent(PooledConnection con,
PreparedStatement statement)
Constructs a StatementEvent with the specified PooledConnection and PreparedStatement. The SQLException contained in the event defaults to null.
Parameters:
con - The PooledConnection that the closed or invalid PreparedStatementis associated with.
statement - The PreparedStatement that is bieng closed or is invalid
------------------------------------------------------------------------------------------
But the constructor throws IllegalArgumentException:
------------
import javax.sql.StatementEvent;
public class Test {
/** Creates a new instance of Test */
public static void main(String[] argv) {
try {
StatementEvent a = new StatementEvent(null, null);
} catch (IllegalArgumentException e) {
System.out.println("Unexpected " + e);
}
}
}
-----------
run-single:
Unexpected java.lang.IllegalArgumentException: null source
------------------------------------------------------------------------------------------
public StatementEvent(PooledConnection con,
PreparedStatement statement)
Constructs a StatementEvent with the specified PooledConnection and PreparedStatement. The SQLException contained in the event defaults to null.
Parameters:
con - The PooledConnection that the closed or invalid PreparedStatementis associated with.
statement - The PreparedStatement that is bieng closed or is invalid
------------------------------------------------------------------------------------------
But the constructor throws IllegalArgumentException:
------------
import javax.sql.StatementEvent;
public class Test {
/** Creates a new instance of Test */
public static void main(String[] argv) {
try {
StatementEvent a = new StatementEvent(null, null);
} catch (IllegalArgumentException e) {
System.out.println("Unexpected " + e);
}
}
}
-----------
run-single:
Unexpected java.lang.IllegalArgumentException: null source