RDBDocumentStore: potential NPE in error handling code
@@ -1949,7 +1949,7 @@ public class RDBDocumentStore implements DocumentStore {
} catch (SQLException ex) {
this.ch.rollbackConnection(connection);
String addDiags = "";
- if (RDBJDBCTools.matchesSQLState(ex, "22", "72")) {
+ if (data != null && RDBJDBCTools.matchesSQLState(ex, "22", "72")) {
byte[] bytes = asBytes(data);
addDiags = String.format(" (DATA size in Java characters: %d, in octets: %d, computed character limit: %d)",
data.length(), bytes.length, tmd.getDataLimitInOctets() / CHAR2OCTETRATIO);
@@ -2058,7 +2058,7 @@ public class RDBDocumentStore implements DocumentStore {
private static final boolean BATCHUPDATES = Boolean.parseBoolean(System
.getProperty("org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.BATCHUPDATES", "true"));
- public static byte[] asBytes(String data) {
+ public static byte[] asBytes(@Nonnull String data) {
byte[] bytes;
try {
bytes = data.getBytes("UTF-8");
