Source:
<code>private DBParameter populateDBParameter(List<String> fieldNames, List<String> initialIncludedFields, List<Object> initialArgs, String indexName, BasicDocumentRevision rev) { List<String> includeFieldNames = new ArrayList<String>(); includeFieldNames.addAll(initialIncludedFields); List<Object> args = new ArrayList<Object>(); args.addAll(initialArgs); for (String fieldName: fieldNames) { if (initialIncludedFields.contains(fieldName)) { continue; } Object value = ValueExtractor.extractValueForFieldName(fieldName, rev.getBody()); if (value != null) { if (value instanceof List && ((List) value).size() == 0) { continue; } includeFieldNames.add(fieldName); <START> args.add(value); <END> } } ContentValues contentValues = new ContentValues(); int argIndex = 0; for (String fieldName: includeFieldNames) { fieldName = String.format("\"%s\"", fieldName); Object argument = args.get(argIndex); if (argument instanceof Boolean) { contentValues.put(fieldName, (Boolean) argument); } else if (argument instanceof Byte) { contentValues.put(fieldName, (Byte) argument); } else if (argument instanceof byte[]) { contentValues.put(fieldName, (byte[]) argument); } else if (argument instanceof Double) { contentValues.put(fieldName, (Double) argument); } else if (argument instanceof Float) { contentValues.put(fieldName, (Float) argument); } else if (argument instanceof Integer) { contentValues.put(fieldName, (Integer) argument); } else if (argument instanceof Long) { contentValues.put(fieldName, (Long) argument); } else if (argument instanceof Short) { contentValues.put(fieldName, (Short) argument); } else if (argument instanceof String) { contentValues.put(fieldName, (String) argument); } else { contentValues.put(fieldName, (String) null); } argIndex = argIndex + 1; } String tableName = IndexManager.tableNameForIndex(indexName); return new DBParameter(tableName, contentValues); }</code><technical_language>So, array's added this args list twice? part of initialArgs line 309, right? get added again</technical_language>

Target:
private DBParameter populateDBParameter(List<String> fieldNames, List<String> initialIncludedFields, List<Object> initialArgs, String indexName, BasicDocumentRevision rev) { List<String> includeFieldNames = new ArrayList<String>(); includeFieldNames.addAll(initialIncludedFields); List<Object> args = new ArrayList<Object>(); args.addAll(initialArgs); for (String fieldName: fieldNames) { if (initialIncludedFields.contains(fieldName)) { continue; } Object value = ValueExtractor.extractValueForFieldName(fieldName, rev.getBody()); if (value != null && !(value instanceof List && ((List) value).size() == 0)) { includeFieldNames.add(fieldName); args.add(value); } } ContentValues contentValues = new ContentValues(); int argIndex = 0; for (String fieldName: includeFieldNames) { fieldName = String.format("\"%s\"", fieldName); Object argument = args.get(argIndex); if (argument instanceof Boolean) { contentValues.put(fieldName, (Boolean) argument); } else if (argument instanceof Byte) { contentValues.put(fieldName, (Byte) argument); } else if (argument instanceof byte[]) { contentValues.put(fieldName, (byte[]) argument); } else if (argument instanceof Double) { contentValues.put(fieldName, (Double) argument); } else if (argument instanceof Float) { contentValues.put(fieldName, (Float) argument); } else if (argument instanceof Integer) { contentValues.put(fieldName, (Integer) argument); } else if (argument instanceof Long) { contentValues.put(fieldName, (Long) argument); } else if (argument instanceof Short) { contentValues.put(fieldName, (Short) argument); } else if (argument instanceof String) { contentValues.put(fieldName, (String) argument); } else { contentValues.put(fieldName, (String) null); } argIndex = argIndex + 1; } String tableName = IndexManager.tableNameForIndex(indexName); return new DBParameter(tableName, contentValues); }