> you might expect the Japanese language to show close affinities to some mainland language
Like the extensive use of Chinese characters in their writing system?
I started learning basic Japanese after learning Korean to an intermediate level, and was surprised that the grammar was almost identical for simple phrases.
No genetic affinities is what is meant there. Viet, Korean, and Japanese all borrow up to 60% of their vocabulary from Chinese. But none of them have a strong relationship with Chinese or each other. As far as we can tell, so far, Japanese languages are isolates.
Most linguists have historically categorized the Japonic languages and the Korean language as isolates. But, even though the technical elements between the two languages may bear no relationship with each other, the phonetic similarities between the two languages are pretty interesting. Also, at times, the grammatical features and structures between Japanese and Korean are more similar to each other than Japanese is to Chinese or Korean is to Chinese (e.g. Japanese and Korean are SOV word order [1] languages whereas Chinese is an SVO word order [2] language).
Of course, there's debate as to whether these similarities between the Japanese and Korean languages are a result of language convergence or divergence. But considering how close the two countries are (historically and geographically), it's probably a mix of both.
Like the extensive use of Chinese characters in their writing system?
I started learning basic Japanese after learning Korean to an intermediate level, and was surprised that the grammar was almost identical for simple phrases.