The question How should I approach a Tokyo University professor to join their lab? has an answer by RoboKaren saying:
For professors in Japan, taking on students is a tremendous responsibility and burden. Unlike in the United States or Europe, professors are responsible for even the extracurricular activities of students (i.e., getting arrested; showing up drunk and groping someone; having an apartment so messy that the landlord complains, etc.). They are also responsible for the student's career after they graduate.
This sounds very interesting as I have never heard such things about any other country before.
So, I want to ask:
What happens/could happen to a Japanese professor if their student has e.g. a messy apartment?
Is there something similar for undergraduate students (who, I suppose, do not have a professor in the sense above)? Is the university somehow responsible for them?
Where is this responsibility stated? Is it e.g. in the law, or is it rather some non-official convention that everybody follows, or something in between?