Source:
<code>private <T extends Item> Collection<T> executeQuery(final AttributeQuery query, final Class<T> itemClass) { final ItemConfiguration itemConfiguration = getItemConfiguration(itemClass); final String tableName = databaseSchemaHolder.schemaName() + "." + itemConfiguration.tableName(); final Table table = dynamoDBClient.getTable(tableName); final List<T> totalItems = new ArrayList<>(); if (itemConfiguration.hasIndexOn(query.getAttributeName()) && query.getCondition().getComparisonOperator().equals(Operators.EQUALS)) { final Index index = table.getIndex(query.getAttributeName() + "_idx"); final QuerySpec querySpec = generateQuerySpec(query); final ItemCollection<QueryOutcome> queryOutcome = index.query(querySpec); final Iterator<com.amazonaws.services.dynamodbv2.document.Item> iterator = queryOutcome.iterator(); while (iterator.hasNext()) { final com.amazonaws.services.dynamodbv2.document.Item item = iterator.next(); totalItems.add(stringToItem(item.toJSON(), itemClass)); } } else { <START> logger.debug("Performing table scan"); <END> ScanSpec scanSpec = null; try { scanSpec = generateScanSpec(query, itemClass); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new PersistenceResourceFailureException("Could not create ScanSpec for query: " + query, e); } final ItemCollection<ScanOutcome> scanOutcome = table.scan(scanSpec); final Iterator<com.amazonaws.services.dynamodbv2.document.Item> iterator = scanOutcome.iterator(); while (iterator.hasNext()) { final com.amazonaws.services.dynamodbv2.document.Item item = iterator.next(); totalItems.add(stringToItem(item.toJSON(), itemClass)); } } return totalItems; }</code><technical_language>show query too</technical_language>

Target:
private <T extends Item> Collection<T> executeQuery(final AttributeQuery query, final Class<T> itemClass) { final ItemConfiguration itemConfiguration = getItemConfiguration(itemClass); final String tableName = databaseSchemaHolder.schemaName() + "." + itemConfiguration.tableName(); final Table table = dynamoDBClient.getTable(tableName); final List<T> totalItems = new ArrayList<>(); if (itemConfiguration.hasIndexOn(query.getAttributeName()) && query.getCondition().getComparisonOperator().equals(Operators.EQUALS)) { final Index index = table.getIndex(query.getAttributeName() + "_idx"); final QuerySpec querySpec = generateQuerySpec(query); final ItemCollection<QueryOutcome> queryOutcome = index.query(querySpec); final Iterator<com.amazonaws.services.dynamodbv2.document.Item> iterator = queryOutcome.iterator(); while (iterator.hasNext()) { final com.amazonaws.services.dynamodbv2.document.Item item = iterator.next(); totalItems.add(stringToItem(item.toJSON(), itemClass)); } } else { logger.debug("Performing table scan with query: " + query); ScanSpec scanSpec = null; try { scanSpec = generateScanSpec(query, itemClass); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new PersistenceResourceFailureException("Could not create ScanSpec for query: " + query, e); } final ItemCollection<ScanOutcome> scanOutcome = table.scan(scanSpec); final Iterator<com.amazonaws.services.dynamodbv2.document.Item> iterator = scanOutcome.iterator(); while (iterator.hasNext()) { final com.amazonaws.services.dynamodbv2.document.Item item = iterator.next(); totalItems.add(stringToItem(item.toJSON(), itemClass)); } } return totalItems; }