From 5009ed618f2aa34337c146758b301af1b749f731 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sun, 12 Sep 2021 01:50:07 +0200 Subject: [PATCH] Java: Extend functional interfaces test --- .../library-tests/functional-interfaces/Test.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/java/ql/test/library-tests/functional-interfaces/Test.java b/java/ql/test/library-tests/functional-interfaces/Test.java index ad0d4c079b42..a07881e07be6 100644 --- a/java/ql/test/library-tests/functional-interfaces/Test.java +++ b/java/ql/test/library-tests/functional-interfaces/Test.java @@ -21,9 +21,19 @@ interface NotFunctional { interface FunctionalWithObjectMethods { int f(); + // Not actually abstract; implementation comes from Object + boolean equals(Object obj); + int hashCode(); String toString(); + } - int hashCode(); + interface NotFunctionalWithObjectMethods { + int f(); + + // Increases their visibility from `protected` to `public`; this requires subclasses to implement them + // See also JLS section "Functional Interfaces" which explicitly covers this + Object clone(); + void finalize(); } }