Implemented Exception Throwing

This commit is contained in:
vegowotenks 2024-11-12 14:34:42 +01:00
parent f5428c79b2
commit 8e5b6bb2b8
5 changed files with 224 additions and 9 deletions

View file

@ -375,6 +375,15 @@ impl JavaClassFile {
return Ok((class_name, method_name, method_descriptor));
}
pub fn gather_methodref_compatible(&self, methodref_index: u16) -> Result<(&String, &String, &String), Error> {
return match self.pool_entry(methodref_index) {
Ok(ConstantPoolInfo::MethodRef(_)) => self.gather_methodref(methodref_index),
Ok(ConstantPoolInfo::InterfaceMethodRef(_)) => self.gather_interfacemethodref(methodref_index),
Err(i) => Err(i),
_ => unreachable!()
}
}
pub fn sourcefile(&self) -> Result<Option<&String>, Error> {
match (&self.attributes).into_iter()