@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) {
*/
package org.sonar.duplications.block;
-import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.util.Arrays;
//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);
* @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);
}
/**