China uses these outbursts of nationalism, whipped up by state media, to punish offending countries.