aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/FieldAware.java6
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/block/ByteArray.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java4
3 files changed, 6 insertions, 7 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/FieldAware.java b/server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/FieldAware.java
index 47a30289863..27d6a27e771 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/FieldAware.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/FieldAware.java
@@ -43,17 +43,17 @@ public abstract class FieldAware<U extends FieldAware<U>> {
@SuppressWarnings("unchecked")
public KeywordFieldBuilder<U> keywordFieldBuilder(String fieldName) {
- return (KeywordFieldBuilder<U>) new KeywordFieldBuilder(this, fieldName);
+ return new KeywordFieldBuilder(this, fieldName);
}
@SuppressWarnings("unchecked")
public TextFieldBuilder<U> textFieldBuilder(String fieldName) {
- return (TextFieldBuilder<U>) new TextFieldBuilder(this, fieldName);
+ return new TextFieldBuilder(this, fieldName);
}
@SuppressWarnings("unchecked")
public NestedFieldBuilder<U> nestedFieldBuilder(String fieldName) {
- return (NestedFieldBuilder<U>) new NestedFieldBuilder(this, fieldName);
+ return new NestedFieldBuilder(this, fieldName);
}
public U createBooleanField(String fieldName) {
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/block/ByteArray.java b/sonar-duplications/src/main/java/org/sonar/duplications/block/ByteArray.java
index 589cb60758c..2cb7546fd50 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/block/ByteArray.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/block/ByteArray.java
@@ -19,7 +19,6 @@
*/
package org.sonar.duplications.block;
-import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.util.Arrays;
@@ -97,7 +96,7 @@ public final class ByteArray {
//This is because the generated byte code includes the static return type of the method, which is not found on Java 8 and lower because
//the overloaded methods with covariant return types don't exist.
- ((Buffer) bb).rewind();
+ bb.rewind();
IntBuffer ib = bb.asIntBuffer();
int[] result = new int[size];
ib.get(result);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java
index 3b311f22cce..54f511321c6 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java
@@ -56,11 +56,11 @@ public final class ZipUtils {
* @return the target directory
*/
public static File unzip(File zip, File toDir) throws IOException {
- return unzip(zip, toDir, (Predicate<ZipEntry>) ze -> true);
+ return unzip(zip, toDir, ze -> true);
}
public static File unzip(InputStream zip, File toDir) throws IOException {
- return unzip(zip, toDir, (Predicate<ZipEntry>) ze -> true);
+ return unzip(zip, toDir, ze -> true);
}
/**