[Monetdb-developers] Workaround for JDK6 Bug 6795561

Bram Van Dam bram.vandam at foresee.be
Thu May 7 12:51:51 CEST 2009


Howdy,

When using the MonetDB JDBC driver on JDK6 (or JRE6) > 6.10 you will get 
IndexOutOfBoundsExceptions when using transactions (possibly in other 
cases as well). This happens because there is a bug in 
CharBuffer.subSequence(), which is used in StartOfHeaderParser.java

The following patch remedies this problem, without any regressions as 
far as I can tell. Recompiling the JDBC driver is all that's required.

You'll still have to compile with the 1.5 option because the JDBC 
interface changed quite a bit between 5 and 6, but if I have time left I 
might fix that as well.

Hope this'll help someone.

--- 
MonetDB-java/java/src/nl/cwi/monetdb/mcl/parser/StartOfHeaderParser.java	Wed 
Mar 04 12:21:50 2009
+++ 
MonetDB-java/java/src/nl/cwi/monetdb/mcl/parser/StartOfHeaderParser.java	Thu 
May 07 11:57:47 2009
@@ -141,8 +141,7 @@
  		while (soh.hasRemaining() && soh.get() != ' ') {
  			cnt++;
  		}
-
  		soh.reset();
-		return(soh.subSequence(0, cnt).toString());
+		return(soh.slice().subSequence(0, cnt).toString());
  	}
  }




More information about the developers-list mailing list