diff --git a/tika-core/src/main/java/org/apache/tika/config/Param.java b/tika-core/src/main/java/org/apache/tika/config/Param.java index 7de36acbc2..a92b9ff9ad 100644 --- a/tika-core/src/main/java/org/apache/tika/config/Param.java +++ b/tika-core/src/main/java/org/apache/tika/config/Param.java @@ -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; @@ -90,7 +89,6 @@ public class Param implements Serializable { //one of these two is used for serialization private final List valueStrings = new ArrayList<>(); - private final Map valueMap = new LinkedHashMap<>(); private Class type; private String name; @@ -105,9 +103,7 @@ public Param(String name, Class 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) { @@ -250,7 +246,6 @@ private static void loadMap(Param 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(); } diff --git a/tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/reports/Report.java b/tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/reports/Report.java index 4c2274ac95..6982aaad6d 100644 --- a/tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/reports/Report.java +++ b/tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/reports/Report.java @@ -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; @@ -100,14 +98,12 @@ private void dumpReportToWorkbook(Statement st, SXSSFWorkbook wb) int rowCount = 0; ResultSetMetaData meta = rs.getMetaData(); - Set 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(); diff --git a/tika-example/src/main/java/org/apache/tika/example/TextStatsFromTikaEval.java b/tika-example/src/main/java/org/apache/tika/example/TextStatsFromTikaEval.java index d12f4b08a9..e2a9fbb839 100644 --- a/tika-example/src/main/java/org/apache/tika/example/TextStatsFromTikaEval.java +++ b/tika-example/src/main/java/org/apache/tika/example/TextStatsFromTikaEval.java @@ -56,7 +56,6 @@ public double getOOV(String txt) { */ CommonTokenResult result = (CommonTokenResult) results.get(CommonTokens.class); - result.getLangCode(); return result.getOOV(); } }