@Test public void testDebugOneStringArg() throws SQLException { Logger logger = mock(Logger.class); when(logger.isDebugEnabled()).thenReturn(true); DataSource.debug(logger, "select x from y where a = ?", "aaa"); verify(logger, times(2)).isDebugEnabled(); verify(logger).debug("{} [{}]", "select x from y where a = ?", "'aaa'"); verifyNoMoreInteractions(logger); }
private static void debug(String sql, @Nullable Object... args) { debug(logger, sql, args); }
DataSource { private static void debug(String sql, @Nullable Object... args) { debug(logger, sql, args); } }
DataSource { private static void debug(String sql, @Nullable Object... args) { debug(logger, sql, args); } DataSource();  DataSource(File dbFile); }
DataSource { private static void debug(String sql, @Nullable Object... args) { debug(logger, sql, args); } DataSource();  DataSource(File dbFile); void defrag(); void compact(); long getH2DataFileSize(); List<H2Table> analyzeH2DiskSpace(); void deleteAll(); void execute(@Untainted String sql); long queryForLong(final @Untainted String sql, Object... args); @Nullable Long queryForOptionalLong(final @Untainted String sql, Object... args); List<String> queryForStringList(final @Untainted String sql); T query(JdbcQuery<T> jdbcQuery); T queryAtMostOne(JdbcRowQuery<T> jdbcQuery); List<T> query(JdbcRowQuery<T> jdbcQuery); int update(final @Untainted String sql, final @Nullable Object... args); int update(JdbcUpdate jdbcUpdate); int[] batchUpdate(JdbcUpdate jdbcUpdate); void deleteBefore(@Untainted String tableName, long captureTime); void deleteBefore(@Untainted String tableName, @Untainted String columnName,
            long captureTime); void deleteBeforeUsingLock(@Untainted String tableName, @Untainted String columnName,
            long captureTime, Object externalLock); void syncTable(@Untainted String tableName, List<Column> columns); void syncIndexes(@Untainted String tableName, ImmutableList<Index> indexes); boolean tableExists(String tableName); boolean columnExists(String tableName, String columnName); void renameTable(@Untainted String oldTableName, @Untainted String newTableName); void renameColumn(@Untainted String tableName, @Untainted String oldColumnName,
            @Untainted String newColumnName); V suppressQueryTimeout(Callable<V> callable); @OnlyUsedByTests void close(); }
DataSource { private static void debug(String sql, @Nullable Object... args) { debug(logger, sql, args); } DataSource();  DataSource(File dbFile); void defrag(); void compact(); long getH2DataFileSize(); List<H2Table> analyzeH2DiskSpace(); void deleteAll(); void execute(@Untainted String sql); long queryForLong(final @Untainted String sql, Object... args); @Nullable Long queryForOptionalLong(final @Untainted String sql, Object... args); List<String> queryForStringList(final @Untainted String sql); T query(JdbcQuery<T> jdbcQuery); T queryAtMostOne(JdbcRowQuery<T> jdbcQuery); List<T> query(JdbcRowQuery<T> jdbcQuery); int update(final @Untainted String sql, final @Nullable Object... args); int update(JdbcUpdate jdbcUpdate); int[] batchUpdate(JdbcUpdate jdbcUpdate); void deleteBefore(@Untainted String tableName, long captureTime); void deleteBefore(@Untainted String tableName, @Untainted String columnName,
            long captureTime); void deleteBeforeUsingLock(@Untainted String tableName, @Untainted String columnName,
            long captureTime, Object externalLock); void syncTable(@Untainted String tableName, List<Column> columns); void syncIndexes(@Untainted String tableName, ImmutableList<Index> indexes); boolean tableExists(String tableName); boolean columnExists(String tableName, String columnName); void renameTable(@Untainted String oldTableName, @Untainted String newTableName); void renameColumn(@Untainted String tableName, @Untainted String oldColumnName,
            @Untainted String newColumnName); V suppressQueryTimeout(Callable<V> callable); @OnlyUsedByTests void close();  }