The Prime Minister's comments in praise of Japanese soldiers during World War II have angered China. This isn't just shaky diplomacy - it's also poor history, writes Kerry Brown.

While the one golden rule of diplomacy is that there are no golden rules, a pretty good rule of thumb is that when engaging with other countries, you become involved in their internal affairs at your peril, and only when you have to.

War, internal instability with international ramifications, flagrant government abuses - all these, when the evidence is there, are valid things to express a view on. But when two countries like Japan and China are having a long-term, highly acrimonious spat that partly involves the present (disputed maritime borders) and partly involves the past (World War II), it best for countries like Australia to steer as far clear as possible of the latter. Being dragged in on one side or another, particularly on historic issues, is usually a losing wicket.

Tony Abbott may learn this the hard way after he made comments during prime minister Shinzo Abe's visit to Australia which seemed to praise Japan's World War II soldiers.

Abe's visit has seen the signing of a significant free trade deal, and the cementing of a stronger bilateral relationship with a country which is, after all, Australia's second largest economic partner, and one which is emerging into healthier growth and offering stronger potential for co-operation. This should have been more than enough to celebrate during the visit, particularly in view of Abbott's chagrin late last year when his comment about Japan being Australia's biggest friend in Asia went down so badly in Beijing.

The relationship with China is a tricky one. Foreign Minister Julie Bishop spoke this week about the need to assert our values and not just focus on the money when we deal with Beijing. At the same time former US secretary of state Hillary Clinton seemed to criticise what she saw as Australia's slavish attitude to China in an interview promoting her recent book.

The current strategy in Canberra however seems sensible enough: diversify, seek friends wherever you can, build the core economic links, and have these as the main thrust of what you are doing. But as Abbott's remarks to Abe make clear, underlying all of this is a very emotional commitment by current Australian leaders to being as visibly faithful and strongly connected to the US, and older allies like Japan, as possible. This urge seems to be pushing Abbott into making unnecessarily forceful remarks about issues that he need not express any opinion on.

The residue of ill-feeling about World War II stains Japan's relations across the region. It is not just China that has an issue with some of Abe's statements, and his moves to review judgements made in the past about the issue of comfort women. However well this might play domestically (and many in Japan don't agree with his more assertive stance on these issues), it is not just China that has responded angrily. South Korea in particular has issued statements expressing worry and dissent.

Japanese inability to deal with the past is an ongoing issue. And expressing any opinion on something so raw and alive today is hazardous.

The point is that it is not just shaky diplomacy that Abbott is practicing when he opines on these things - it is also poor history.

Oxford Professor Rana Mitter's superb study China's War with Japan, issued last year, sets out eloquently and authoritatively just why many in China now might still have strong feelings about this history. Twenty million of their compatriots died in this struggle, and large parts of the country were decimated. Fifty million were made homeless. Cities like Shanghai became bloody war fronts, with terrible human suffering. The pitting of a modernised, industrial nation against one still largely rural and undeveloped was, Mitter argues, something that almost fundamentally destroyed China. It only just survived as a country.

Mitter's book makes one more salient point that Mr Abbott might pay attention to before he speaks up about this matter in the future. China was our ally in that conflict, and its battle fronts were ones that were crucially important for the global struggle against fascism. Australians fought in those battles and made heroic sacrifices.

This is too often forgotten. At that time, it was Japan that posed the threat, managing to attack as far south as Darwin. Praising the Japanese war effort therefore doesn't just cause offence in China - it denigrates Australia's own history.

It is great that Japan is now a strong ally - as a democracy, a liberal trading partner, and a supporter of the international systems of norms and regulations. Building a good relationship between Australia and Japan is logical, and utterly defensible.

These are the things that will matter most, rather than ad hominem views on arguments between two important countries that Australia has no reason to get involved in. That is the reason why it is unlikely we will hear current US secretary of state John Kerry make comments like these in his tour through the region this week. It is not necessary and it does not help.

Professor Kerry Brown is executive director of the China Studies Centre and Professor of Chinese Politics at the University of Sydney. View his full profile here.