Skip to content

Commit

Permalink
Add explicit @nonnull to query providers constructor arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
milderhc committed Aug 21, 2024
1 parent 3ae3fc3 commit 07e1f5b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.microsoft.semantickernel.exceptions.SKException;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import javax.annotation.Nonnull;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
Expand All @@ -26,8 +27,11 @@ public class MySQLVectorStoreQueryProvider extends
private final ObjectMapper objectMapper;

@SuppressFBWarnings("EI_EXPOSE_REP2")
private MySQLVectorStoreQueryProvider(DataSource dataSource, String collectionsTable,
String prefixForCollectionTables, ObjectMapper objectMapper) {
private MySQLVectorStoreQueryProvider(
@Nonnull DataSource dataSource,
@Nonnull String collectionsTable,
@Nonnull String prefixForCollectionTables,
@Nonnull ObjectMapper objectMapper) {
super(dataSource, collectionsTable, prefixForCollectionTables);
this.dataSource = dataSource;
this.objectMapper = objectMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.microsoft.semantickernel.exceptions.SKException;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import javax.annotation.Nonnull;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
Expand All @@ -27,6 +28,7 @@

public class PostgreSQLVectorStoreQueryProvider extends
JDBCVectorStoreDefaultQueryProvider implements JDBCVectorStoreQueryProvider {

private final Map<Class<?>, String> supportedKeyTypes;
private final Map<Class<?>, String> supportedDataTypes;
private final Map<Class<?>, String> supportedVectorTypes;
Expand All @@ -37,8 +39,11 @@ public class PostgreSQLVectorStoreQueryProvider extends
private final ObjectMapper objectMapper;

@SuppressFBWarnings("EI_EXPOSE_REP2")
private PostgreSQLVectorStoreQueryProvider(DataSource dataSource, String collectionsTable,
String prefixForCollectionTables, ObjectMapper objectMapper) {
private PostgreSQLVectorStoreQueryProvider(
@Nonnull DataSource dataSource,
@Nonnull String collectionsTable,
@Nonnull String prefixForCollectionTables,
@Nonnull ObjectMapper objectMapper) {
super(dataSource, collectionsTable, prefixForCollectionTables);
this.dataSource = dataSource;
this.collectionsTable = collectionsTable;
Expand Down

0 comments on commit 07e1f5b

Please sign in to comment.