+ # All classes, from this pass and from other passes
+ var all_classes: HashMap[String, JavaClass] is noserialize, lazy do
+ var classes = new HashMap[String, JavaClass]
+ classes.add_all self.classes
+
+ for model_path in sys.opt_load_models.value do
+ if not model_path.file_exists then
+ print_error "Error: model file '{model_path}' does not exist"
+ continue
+ end
+
+ var file = model_path.to_path.open_ro
+ var d = new BinaryDeserializer(file)
+ var model = d.deserialize
+ file.close
+
+ if d.errors.not_empty then
+ print_error "Error: failed to deserialize model file '{model_path}' with: {d.errors.join(", ")}"
+ continue
+ end
+
+ if not model isa JavaModel then
+ print_error "Error: model file contained a '{if model == null then "null" else model.class_name}'"
+ continue
+ end
+
+ classes.add_all model.classes
+ end
+
+ return classes
+ end
+
+ # Does this model have access to the `java.lang.Object`?
+ var knows_the_object_class: Bool = all_classes.keys.has("java.lang.Object") is lazy
+