Xi Jinping, the man widely tipped to succeed Hu Jintao as China's president in 2012, dropped in on Japan's emperor this week. Though such visits are normally arranged months in advance, Beijing gave just a couple of days' notice, the equivalent in imperial-etiquette terms of loudly banging on your neighbour's door at 3am asking to borrow a cup of sugar.
A request by Yukio Hatoyama, Japan's freshly installed prime minister, that an audience be granted even at such short notice, was criticised by some in Japan, particularly on the right. They saw in it a willingness by the new left-of-centre government to kowtow to Beijing. Even the normally discreet head of the Imperial Household Agency, the stern and secretive body that controls the royal schedule, objected publicly that the emperor should not be used as a diplomatic tool.
These minor ructions obscured the more important fact: that the meeting took place at all. Mr Xi did not bow (cf Barack Obama). But he did coo, in no doubt entirely off-the-cuff remarks: "I hope my visit will contribute to the development of friendly co-operation between the two countries and boost friendship between the two peoples."
You only need to cast your mind a few years back to realise how remarkable has been the change in tone. Throughout the nearly six years of Junichiro Koizumi's premiership, ending in 2006, the two countries were far more likely to be hurling diplomatic mud than trading scripted niceties. Mr Koizumi's penchant for visiting Yasukuni shrine, a Japanese war memorial vilified by Beijing, meant he was effectively banned from setting foot on Chinese soil. Relations entered dangerous territory in 2005 when Japan's (aborted) endeavour to secure itself a permanent seat on the United Nations Security Council sparked three weeks of anti-Japanese demonstrations in which Japanese commercial and diplomatic interests were attacked the length and breadth of China.
Those mass protests may have been enough to convince Beijing that its anti-Japanese card - useful for fostering nationalist sentiment in the years after Tiananmen - had been overplayed. Certainly, the Communist party leadership went out of its way to hold out an olive branch to Shinzo Abe, who followed Mr Koizumi into office, even though he was more overtly nationalist than his predecessor. The two countries' promise to build a mutually beneficial relationship uncorked a torrent of diplomatic froth, including meticulously choreographed visits to Tokyo by both Mr Hu and Wen Jiabao, China's premier.
Remarkably, this detente - weaved with fine words rather than built with concrete actions - has held, and even flourished. Contrast that with the sorry state of the other important relationships in the region. China and India have become locked in an increasingly nasty dispute over territory and geopolitical influence. Even Japan and the US, normally the best buddies in the Pacific, have fallen out over alliance-related issues, specifically Mr Hatoyama's reluctance to endorse a decade-old plan to relocate a US marine base on the island of Okinawa.
By comparison, Sino-Japanese relations have rarely been better. That is primarily because Beijing wishes it to be so. But why? Part of the reason is that China's campaign to persuade the world that its rise is non-threatening is served by warmer ties with Japan. China also - and whisper it quietly - admires some aspects of Japan's postwar development, from which it still has much to learn. Take the environment. Four decades ago Japan's air and rivers were almost as poisonous as those of China today. Since then it has marshalled public policy and technological solutions to become one of the world's cleanest and most energy-efficient economies. Beijing would like to know how.


