-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b63
-
generic
-
generic
Constuctor public ClientInfoException(Properties failedProperties, Throwable cause) does not properly initialize the Reason if cause is not null. The spec says:
...
The reason is initialized to null if cause==null or to cause.toString() if cause!=null and the vendor code is initialized to 0.
...
In fact, the getMessage() returns null reason even the cause is not null. See example below:
import java.sql.ClientInfoException;
import java.util.Properties;
/
public class Test {
/** Creates a new instance of Test */
public static void main(String[] argv) {
final Throwable cause = new Throwable();
final ClientInfoException e = new ClientInfoException(new Properties(),
cause);
System.out.println("Returned: " + e.getMessage());
// The reason is initialized to null if cause==null or to
//cause.toString() if cause!=null and the vendor code is
//initialized to 0.
System.out.println("Expected: " + cause.toString());
}
}
run-single:
Returned: null
Expected: java.lang.Throwable
...
The reason is initialized to null if cause==null or to cause.toString() if cause!=null and the vendor code is initialized to 0.
...
In fact, the getMessage() returns null reason even the cause is not null. See example below:
import java.sql.ClientInfoException;
import java.util.Properties;
/
public class Test {
/** Creates a new instance of Test */
public static void main(String[] argv) {
final Throwable cause = new Throwable();
final ClientInfoException e = new ClientInfoException(new Properties(),
cause);
System.out.println("Returned: " + e.getMessage());
// The reason is initialized to null if cause==null or to
//cause.toString() if cause!=null and the vendor code is
//initialized to 0.
System.out.println("Expected: " + cause.toString());
}
}
run-single:
Returned: null
Expected: java.lang.Throwable