Skip to content

Commit dde07fd

Browse files
authored
Merge pull request github#6672 from Marcono1234/marcono1234/functional-interfaces-test
Java: Extend functional interfaces test
2 parents 4628f88 + 5009ed6 commit dde07fd

File tree

1 file changed

+11
-1
lines changed
  • java/ql/test/library-tests/functional-interfaces

1 file changed

+11
-1
lines changed

java/ql/test/library-tests/functional-interfaces/Test.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@ interface NotFunctional {
2121
interface FunctionalWithObjectMethods {
2222
int f();
2323

24+
// Not actually abstract; implementation comes from Object
25+
boolean equals(Object obj);
26+
int hashCode();
2427
String toString();
28+
}
2529

26-
int hashCode();
30+
interface NotFunctionalWithObjectMethods {
31+
int f();
32+
33+
// Increases their visibility from `protected` to `public`; this requires subclasses to implement them
34+
// See also JLS section "Functional Interfaces" which explicitly covers this
35+
Object clone();
36+
void finalize();
2737
}
2838

2939
}

0 commit comments

Comments
 (0)