HARDLY a day goes by without a new flare-up in the war of diplomatic attrition being fought out by China and Japan. Japan is still complaining about China’s declaration in November of an “Air Defence Identification Zone” covering part of the East China Sea, including islands controlled by Japan. China keeps condemning the visit on December 26th by Shinzo Abe, Japan’s prime minister, to the Yasukuni shrine in Tokyo, where among the war dead honoured are high-ranking war criminals. Since then more than 30 Chinese ambassadors have invaded the op-ed pages of newspapers around the world to accuse Japan of seeking to revive its militarist past. Japanese diplomats have responded with articles accusing China of aggressive military expansion.

Neither country is winning this war of words. This week it moved to the World Economic Forum in Davos, where Mr Abe again criticised China’s military build-up, and caused alarm by likening the rivalry between China and Japan to that between Germany and Britain before the first world war. Scare-mongering, perhaps. But it highlights the real risks in a diplomatic quarrel that is usually seen as somewhere on the spectrum between amusing, embarrassing and mildly alarming—like watching a dinner-party tiff as it threatens to turn into fisticuffs. Most other countries see no reason to intervene or take sides. Indeed, some may hope to benefit from this contest for their loyalties.

Only in South Korea does the battle for public opinion produce a clear winner. This week China rejected criticism from Japan of a monument unveiled on January 19th in its northern city of Harbin to Ahn Jung-geun, a Korean nationalist executed by Japan in 1910 after he had carried out an assassination in the city. Japan regards Ahn, who killed Hirobumi Ito, Japan’s colonial governor in Korea, as a “terrorist”. China’s spokesman, however, calling him “a famous righteous man”, at once switched the conversation to Mr Abe’s Yasukuni visit. South Korea’s ties with China are flourishing and the country’s president, Park Geun-hye, requested this statue be built when she was in China last June.

Elsewhere, however, the finger-pointing and name-calling has made both countries look petty. The nadir has been the resort by envoys in Britain to the Harry Potter books. Japan was Voldemort, said China’s ambassador, referring to the evil wizard of the series. Displaying an impressive familiarity with J.K. Rowling’s oeuvre, he added that Yasukuni was a “horcrux”, a receptacle where the evil one secreted part of his soul. Not so, retorted Japan’s ambassador, it is China that is playing Voldemort, “letting loose the evil of an arms race and escalation of tensions”.

Just as unseemly was a row over a trip by Mr Abe to Côte d’Ivoire, Mozambique and Ethiopia this month. The first visit to Africa by a serving Japanese prime minister in eight years, it was designed to counter China’s success in building diplomatic support and winning access to raw materials. So Mr Abe made lavish offers of aid. A spokesman, making a tacit comparison with China, noted that Japanese aid concentrated on helping young people and women, not building “beautiful houses or beautiful ministerial buildings”. In response, China’s ambassador to the African Union called Mr Abe the biggest “troublemaker” in Asia and brandished photographs of Japanese wartime atrocities.

China is sensitive to the charge that its oft-repeated mantra of non-interference in other countries’ affairs is a cover for unstinting support for any thug who happens to be in power at the moment. It could have responded to Japan’s jab by accusing it of hypocrisy. Japan, too, has at times been criticised in similar terms: it maintained humanitarian aid for Myanmar, for example, when its former military junta was shunned by America and Europe.

But China chose instead to talk about the war, even though Japan has been at peace for 70 years and memories of wartime Asia resonate only faintly in Africa. Even in countries with a direct experience of Japanese occupation, China’s approach seems ineffective. Asian governments disapprove of Mr Abe’s going to Yasukuni. But few seem worried by his plans to boost defence spending. On the contrary, most quietly welcome it, being far more concerned about China’s military build-up and its vigorous assertion of its claims in maritime disputes.

So Mr Abe’s assiduous courtship of South-East Asia—he visited all ten members of the Association of South-East Asian Nations in his first year in office—is unlikely to be undone by anger over Yasukuni. China is losing ground in the region. In Myanmar, for example, an opening to the West since 2011 has been in part an attempt to be less dependent on China. Cambodia’s strongman, Hun Sen, has long extolled the benefits of partnership with China and its string-free aid. But he too is cultivating ties with Japan, announcing a “strategic partnership” last month. China itself signalled a new distance from its client when, unusually, its official news agency advised Mr Hun Sen to pursue political reform.

Don’t mention the war

Thankfully, this is not yet the first world war, or even the cold war, where Soviet and American allies fell into two mutually hostile camps. Countries do not have to choose between China and Japan. Instead they can hope the two countries’ mutual antipathy stokes competitive generosity. That hope, however, is overshadowed by the fear that it might tip over into conflict—that at this diplomatic dinner party, someone might actually throw a punch.

For China, the lesson should be obvious. The way to win support in its argument with Japan about history is less to excoriate Japan for its past than to moderate its own present-day behaviour so that it is not seen as a threat. In the South China Sea, for example, the Philippines and Vietnam in particular accuse China of pursuing its territorial claims ever more aggressively. For Japan, the moral is equally clear, though not to Mr Abe: do not give China and others the chance to harp on about a war fought long ago by reviving the past with visits to Yasukuni.

Economist.com/blogs/banyan