This commit is contained in:
Jean-Marie Mineau 2025-04-01 15:55:33 +02:00
parent a374769389
commit edd15fce67
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
4 changed files with 54 additions and 28 deletions

View file

@ -112,6 +112,14 @@ pub struct ReflectionInvokeData {
// TODO: type of invoke?
}
impl ReflectionInvokeData {
pub fn get_static_callee(&self) -> IdMethod {
self.renamed_method
.clone()
.unwrap_or_else(|| self.method.clone())
}
}
/// Structure storing the runtime information of a reflection instanciation using
/// `java.lang.Class.newInstance()`.
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
@ -132,6 +140,14 @@ pub struct ReflectionClassNewInstData {
pub addr: usize,
}
impl ReflectionClassNewInstData {
pub fn get_static_constructor(&self) -> IdMethod {
self.renamed_constructor
.clone()
.unwrap_or_else(|| self.constructor.clone())
}
}
/// Structure storing the runtime information of a reflection instanciation using
/// `java.lang.reflect.Constructor.newInstance()`.
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
@ -152,6 +168,14 @@ pub struct ReflectionCnstrNewInstData {
pub addr: usize,
}
impl ReflectionCnstrNewInstData {
pub fn get_static_constructor(&self) -> IdMethod {
self.renamed_constructor
.clone()
.unwrap_or_else(|| self.constructor.clone())
}
}
/// Structure storing the runtime information of a dynamic code loading.
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
pub struct DynamicCodeLoadingData {