Merge pull request #18789 from rmuir/java9_localdate_you_just_had_to_do_this_didnt_you
painless: exempt LocalDate from bridge method checks on java 9
This commit is contained in:
commit
6202b63ba7
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.painless;
|
package org.elasticsearch.painless;
|
||||||
|
|
||||||
|
import org.apache.lucene.util.Constants;
|
||||||
import org.apache.lucene.util.SetOnce;
|
import org.apache.lucene.util.SetOnce;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -28,6 +29,7 @@ import java.lang.invoke.MethodHandle;
|
||||||
import java.lang.invoke.MethodHandles;
|
import java.lang.invoke.MethodHandles;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -864,6 +866,9 @@ public final class Definition {
|
||||||
// ok
|
// ok
|
||||||
} else if (child.clazz == Spliterator.OfPrimitive.class || child.clazz == PrimitiveIterator.class) {
|
} else if (child.clazz == Spliterator.OfPrimitive.class || child.clazz == PrimitiveIterator.class) {
|
||||||
// ok, we rely on generics erasure for these (its guaranteed in the javadocs though!!!!)
|
// ok, we rely on generics erasure for these (its guaranteed in the javadocs though!!!!)
|
||||||
|
} else if (Constants.JRE_IS_MINIMUM_JAVA9 && owner.clazz == LocalDate.class) {
|
||||||
|
// ok, java 9 added covariant override for LocalDate.getEra() to return IsoEra:
|
||||||
|
// https://bugs.openjdk.java.net/browse/JDK-8072746
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Class<?> arguments[] = new Class<?>[method.arguments.size()];
|
Class<?> arguments[] = new Class<?>[method.arguments.size()];
|
||||||
|
|
Loading…
Reference in New Issue