excessive cast requirements

Erik Poupaert erik.poupaert@chello.be
Mon Feb 10 11:49:00 GMT 2003

While trying to build the mysql Connector/J jdbc driver natively with GCJ,
I've run into the same bug as when building SWT natively. We've discussed it
then, but I'm not sure as to whether it will be fixed in 3.3. In the
PreparedStatement.java source, I was forced to add excessive casts:

							                byte b = x[i];
							                switch (b) {
src/com/mysql/jdbc/PreparedStatement.java:399:                case
(byte)'\n': /* Must be escaped for logs */
src/com/mysql/jdbc/PreparedStatement.java:405:                case
src/com/mysql/jdbc/PreparedStatement.java:411:                case
src/com/mysql/jdbc/PreparedStatement.java:417:                case
src/com/mysql/jdbc/PreparedStatement.java:423:                case
(byte)'"': /* Better safe than sorry */
src/com/mysql/jdbc/PreparedStatement.java:429:                case
(byte)'\032': /* This gives problems on Win32 */

We've discussed this on the mailing list, and we came to the conclusion that
the Java specs do not require such casts (adding the byte cast). Has the
problem of excessive cast requirements been addressed for GCJ 3.3? Or is it
hanging somewhere in between fixing?

In my impression, these excessive cast requirements prevent quite a few
source trees from compiling out of the box with GCJ.

More information about the Java mailing list