Prettified in decode_java_string

This commit is contained in:
VegOwOtenks 2024-11-04 11:49:33 +01:00
parent aba29af0a3
commit 49916f5564

View file

@ -63,7 +63,10 @@ impl HeapArea {
} }
pub fn decode_java_string(&mut self, string_ref: ObjectReference, class_store: &ClassStore) -> String { pub fn decode_java_string(&mut self, string_ref: ObjectReference, class_store: &ClassStore) -> String {
let byte_array_reference = self.object_area.get_object_field(string_ref, "value", self.object_area.get_object_class_index(string_ref), class_store).unwrap().expect_reference(); let byte_array_reference = self.object_area
.get_object_field(string_ref, "value", self.object_area.get_object_class_index(string_ref), class_store)
.unwrap()
.expect_reference();
let byte_array_length = self.object_area.get_array_length(byte_array_reference); let byte_array_length = self.object_area.get_array_length(byte_array_reference);
let mut utf16_bytes = Vec::with_capacity(byte_array_length / 2); let mut utf16_bytes = Vec::with_capacity(byte_array_length / 2);