Skip to content

Commit 2233abd

Browse files
committed
WIP
1 parent 64f9d24 commit 2233abd

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/Kernel/Mnemonics/_invokeinterface.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,27 @@ public function execute(): void
5353
// If targeted method is an abstract or method is undefined, then to find in InnerClass.
5454
// NOTE: Currently, nested InnerClass does not supported.
5555

56+
$foundClass = false;
5657
foreach ($objectref->getDefinedInnerClasses() as [$class]) {
5758
/**
5859
* @var JavaClass $class
5960
*/
60-
if ($class->getClassName() === $className) {
61-
$class->getInvoker()->getDynamic()->getMethods()->call(
62-
$name,
63-
...$arguments
64-
);
65-
break;
61+
if ($class->getClassName() !== $className) {
62+
continue;
6663
}
64+
65+
$class->getInvoker()->getDynamic()->getMethods()->call(
66+
$name,
67+
...$arguments
68+
);
69+
70+
$foundClass = true;
71+
break;
72+
}
73+
74+
// Throw an exception if not found a class.
75+
if (!$foundClass) {
76+
throw $e;
6777
}
6878
}
6979
}

0 commit comments

Comments
 (0)