Remove use of deprecated constructors
Change-Id: I92a11a2a7d45c65bce408714973b3dd5576f4d0d
diff --git a/pom.xml b/pom.xml
index 71907d4..781bf67 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,7 @@
</developers>
<properties>
- <java.version>11</java.version>
+ <java.version>17</java.version>
<jersey.version>3.0.4</jersey.version>
<jackson.version>2.14.0</jackson.version>
<log4j.version>[2.19.0,)</log4j.version>
diff --git a/src/main/java/de/ids_mannheim/korap/KrillIndex.java b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
index 6768bcf..e19ebd1 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
@@ -819,7 +819,7 @@
Text text = new Text();
// Rewrite parse ID
- uid = new Integer(Integer.parseInt(uid)).toString();
+ uid = Integer.valueOf(Integer.parseInt(uid)).toString();
Filter filter = (Filter) new QueryWrapperFilter(
new TermQuery(new Term("UID", uid)));
diff --git a/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java b/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
index 9edd50c..3ab8aef 100644
--- a/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
+++ b/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
@@ -216,7 +216,7 @@
public void setUID (int UID) {
if (UID != 0) {
this.UID = UID;
- this.addString("UID", new Integer(UID).toString());
+ this.addString("UID", Integer.valueOf(UID).toString());
}
};
@@ -233,7 +233,7 @@
public void setUID (String UID) throws NumberFormatException {
if (UID != null) {
this.UID = Integer.parseInt(UID);
- this.addString("UID", new Integer(this.UID).toString());
+ this.addString("UID", Integer.valueOf(this.UID).toString());
};
};
@@ -511,7 +511,7 @@
@JsonIgnore
public void addInt (String key, int value) {
- this.addInt(key, new Integer(value).toString());
+ this.addInt(key, Integer.valueOf(value).toString());
};
@@ -594,6 +594,6 @@
@JsonIgnore
public void addDate (String key, int value) {
- this.addDate(key, new Integer(value).toString());
+ this.addDate(key, Integer.valueOf(value).toString());
};
};
diff --git a/src/main/java/de/ids_mannheim/korap/index/Indexer.java b/src/main/java/de/ids_mannheim/korap/index/Indexer.java
index ed2f6b9..806b920 100644
--- a/src/main/java/de/ids_mannheim/korap/index/Indexer.java
+++ b/src/main/java/de/ids_mannheim/korap/index/Indexer.java
@@ -187,7 +187,7 @@
.desc("input directories separated by semicolons. The input files "
+ "have to be in <filename>.json.gz format. ")
.hasArgs().argName("input directories").required()
- .valueSeparator(new Character(';')).build());
+ .valueSeparator(Character.valueOf(';')).build());
options.addOption(Option.builder("o").longOpt("outputDir")
.desc("index output directory (defaults to "
+ "krill.indexDir in the configuration.")
diff --git a/src/main/java/de/ids_mannheim/korap/index/PositionsToOffset.java b/src/main/java/de/ids_mannheim/korap/index/PositionsToOffset.java
index 9e9799e..bf135c8 100644
--- a/src/main/java/de/ids_mannheim/korap/index/PositionsToOffset.java
+++ b/src/main/java/de/ids_mannheim/korap/index/PositionsToOffset.java
@@ -45,7 +45,7 @@
public int hashCode () {
long hashCode;
hashCode = (docID * Integer.MAX_VALUE) - Integer.MAX_VALUE + pos;
- return new Long(hashCode).hashCode();
+ return Long.valueOf(hashCode).hashCode();
};
diff --git a/src/main/java/de/ids_mannheim/korap/response/MetaFieldsObj.java b/src/main/java/de/ids_mannheim/korap/response/MetaFieldsObj.java
index 1c60b1d..da8124c 100644
--- a/src/main/java/de/ids_mannheim/korap/response/MetaFieldsObj.java
+++ b/src/main/java/de/ids_mannheim/korap/response/MetaFieldsObj.java
@@ -115,7 +115,7 @@
// Field is a number
else {
mf.type = "type:integer";
- mf.values.add(new Integer(n.intValue()).toString());
+ mf.values.add(Integer.valueOf(n.intValue()).toString());
};
}