Recursively collect interfaces that an interface extends.
(
&self,
iface_name: &str,
class_loader: &dyn Fn(&str) -> Option<Arc<ClassInfo>>,
result: &mut Vec<String>,
seen: &mut HashSet<String>,
)
| 353 | |
| 354 | /// Recursively collect interfaces that an interface extends. |
| 355 | fn collect_parent_interfaces( |
| 356 | &self, |
| 357 | iface_name: &str, |
| 358 | class_loader: &dyn Fn(&str) -> Option<Arc<ClassInfo>>, |
| 359 | result: &mut Vec<String>, |
| 360 | seen: &mut HashSet<String>, |
| 361 | ) { |
| 362 | let Some(iface) = class_loader(iface_name) else { |
| 363 | return; |
| 364 | }; |
| 365 | // Check parent_class (first extended interface). |
| 366 | if let Some(parent) = iface.parent_class |
| 367 | && seen.insert(parent.to_string()) |
| 368 | { |
| 369 | result.push(parent.to_string()); |
| 370 | self.collect_parent_interfaces(&parent, class_loader, result, seen); |
| 371 | } |
| 372 | // Check interfaces list (multi-extends). |
| 373 | for parent_iface in &iface.interfaces { |
| 374 | let s = parent_iface.to_string(); |
| 375 | if seen.insert(s.clone()) { |
| 376 | result.push(s.clone()); |
| 377 | self.collect_parent_interfaces(parent_iface, class_loader, result, seen); |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /// Resolve implementations of a method on an interface/abstract class |
| 383 | /// when invoked from the interface declaration itself (reverse jump |
no test coverage detected