diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Def.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Def.java index e5967501664..889328e58db 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Def.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Def.java @@ -55,6 +55,7 @@ public final class Def { * (to emulate a "arraystore" bytecode using MethodHandles). * This should really be a method in {@link MethodHandles} class! */ + @SuppressWarnings("unused") // getArrayLength() methods are are actually used, javac just does not know :) private static final class ArrayLengthHelper { private static final Lookup PRIV_LOOKUP = MethodHandles.lookup(); @@ -72,24 +73,14 @@ public final class Def { private static final MethodHandle OBJECT_ARRAY_MH = ARRAY_TYPE_MH_MAPPING.get(Object[].class); - // NOTE: the following are actually used, javac just does not know :) - @SuppressWarnings("unused") static int getArrayLength(final boolean[] array) { return array.length; } - @SuppressWarnings("unused") static int getArrayLength(final byte[] array) { return array.length; } - @SuppressWarnings("unused") static int getArrayLength(final short[] array) { return array.length; } - @SuppressWarnings("unused") static int getArrayLength(final int[] array) { return array.length; } - @SuppressWarnings("unused") static int getArrayLength(final long[] array) { return array.length; } - @SuppressWarnings("unused") static int getArrayLength(final char[] array) { return array.length; } - @SuppressWarnings("unused") static int getArrayLength(final float[] array) { return array.length; } - @SuppressWarnings("unused") static int getArrayLength(final double[] array) { return array.length; } - @SuppressWarnings("unused") static int getArrayLength(final Object[] array) { return array.length; } static MethodHandle arrayLengthGetter(Class arrayType) {