Skip to content

Commit

Permalink
TIKA-4290 Removed unused collections and a method call (#1875)
Browse files Browse the repository at this point in the history
* TIKA-4290 Removed unused collections and a method call

* remove unused import

* Remove unused import

---------

Co-authored-by: Tilman Hausherr <[email protected]>
  • Loading branch information
dk2k and THausherr committed Aug 7, 2024
1 parent 2c7b7e9 commit ca3df0b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
7 changes: 1 addition & 6 deletions tika-core/src/main/java/org/apache/tika/config/Param.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
Expand Down Expand Up @@ -90,7 +89,6 @@ public class Param<T> implements Serializable {

//one of these two is used for serialization
private final List<String> valueStrings = new ArrayList<>();
private final Map<String, String> valueMap = new LinkedHashMap<>();

private Class<T> type;
private String name;
Expand All @@ -105,9 +103,7 @@ public Param(String name, Class<T> type, T value) {
this.actualValue = value;
if (List.class.isAssignableFrom(value.getClass())) {
this.valueStrings.addAll((List) value);
} else if (Map.class.isAssignableFrom(value.getClass())) {
valueMap.putAll((Map)value);
} else {
} else if (!Map.class.isAssignableFrom(value.getClass())) {
this.valueStrings.add(value.toString());
}
if (this.type == null) {
Expand Down Expand Up @@ -250,7 +246,6 @@ private static <T> void loadMap(Param<T> ret, Node root) throws TikaConfigExcept
throw new TikaConfigException("Duplicate keys are not allowed: " + key);
}
((Map)ret.actualValue).put(key, value);
ret.valueMap.put(key, value);
}
child = child.getNextSibling();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import java.sql.Statement;
import java.sql.Types;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
Expand Down Expand Up @@ -100,14 +98,12 @@ private void dumpReportToWorkbook(Statement st, SXSSFWorkbook wb)

int rowCount = 0;
ResultSetMetaData meta = rs.getMetaData();
Set<String> colNames = new HashSet<>();

Row xssfRow = sheet.createRow(rowCount++);
//write headers and cache them to check against styles
for (int i = 1; i <= meta.getColumnCount(); i++) {
Cell cell = xssfRow.createCell(i - 1);
cell.setCellValue(meta.getColumnLabel(i));
colNames.add(meta.getColumnLabel(i));
}

ResultSetMetaData resultSetMetaData = rs.getMetaData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public double getOOV(String txt) {
*/

CommonTokenResult result = (CommonTokenResult) results.get(CommonTokens.class);
result.getLangCode();
return result.getOOV();
}
}

0 comments on commit ca3df0b

Please sign in to comment.