From 98149c390404ffe2246c4d722066ec9544637bd4 Mon Sep 17 00:00:00 2001 From: Mark Rotteveel Date: Wed, 25 Sep 2024 10:49:53 +0200 Subject: [PATCH] Fix nullability of FieldDataProvider in FBPreparedStatement --- src/main/org/firebirdsql/jdbc/FBPreparedStatement.java | 4 ++-- src/main/org/firebirdsql/jdbc/field/FieldDataProvider.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/org/firebirdsql/jdbc/FBPreparedStatement.java b/src/main/org/firebirdsql/jdbc/FBPreparedStatement.java index ae7078492..ae9d81292 100644 --- a/src/main/org/firebirdsql/jdbc/FBPreparedStatement.java +++ b/src/main/org/firebirdsql/jdbc/FBPreparedStatement.java @@ -794,11 +794,11 @@ protected void prepareFixedStatement(String sql) throws SQLException { final int fieldPosition = i; FieldDataProvider dataProvider = new FieldDataProvider() { - public byte[] getFieldData() { + public byte @Nullable [] getFieldData() { return fieldValues.getFieldData(fieldPosition); } - public void setFieldData(byte[] data) { + public void setFieldData(byte @Nullable [] data) { fieldValues.setFieldData(fieldPosition, data); } }; diff --git a/src/main/org/firebirdsql/jdbc/field/FieldDataProvider.java b/src/main/org/firebirdsql/jdbc/field/FieldDataProvider.java index 73034765d..e2fc528f3 100644 --- a/src/main/org/firebirdsql/jdbc/field/FieldDataProvider.java +++ b/src/main/org/firebirdsql/jdbc/field/FieldDataProvider.java @@ -18,6 +18,8 @@ */ package org.firebirdsql.jdbc.field; +import org.jspecify.annotations.Nullable; + /** * Provider of the row data. * @@ -32,13 +34,13 @@ public interface FieldDataProvider { * @return contents of the field or null if NULL value was * sent from the server. */ - byte[] getFieldData(); + byte @Nullable [] getFieldData(); /** * Set raw content of the field. * * @param data raw content of the field. */ - void setFieldData(byte[] data); + void setFieldData(byte @Nullable [] data); }