So much for the trade war apocalypse.

While many headlines feature gloom about the precarious state of relations between the U.S. and its economic partners, Japan’s most widely watched indicator has some sunny patches worthy of attention.

Japanese companies plan a surge in capital spending in the year through March 2019, according to the central bank’s quarterly Tankan survey released this week. Some increase was anticipated, in part because the second quarter usually shows an improvement, but the 13.6 percent gain blew away forecasts. It looks even better when compared with the 2.3 percent notched in the preceding three months. The labor market is extremely tight, with the unemployment rate at 2.2 percent, the lowest since 1992.   

Can some of this be attributed to Japanese exceptionalism, chiefly the shrinking population and the country’s traditional reluctance to fully embrace free trade? Sure. But while Japan has ceased to be the biggest game in Asia, it’s a still major player, and its companies are woven into the fabric of the world economy. If the prospect of a trade war is so dire, why are companies prepared to invest so much? They could have just hunkered down. It’s a reality check on the idea that Donald Trump is destroying every aspect of every economy on the planet.

The Tankan suggests that Japan’s contraction in gross domestic product earlier this year was probably a blip. It’s true that overall confidence among large manufacturers slipped, though the guts of the report were upbeat and not just on capital spending. Production capacity is tight. Capital Economics notes that price pressures are the highest in a decade and that firms’ financial positions are the most favorable since 1989.

Japan has had its share of false dawns, and so we won’t get carried away here. For all the relative optimism of the past few years, inflation is still short of the Bank of Japan’s 2 percent target. As a consequence, the BOJ is resisting any underlying change to its ultra-easy monetary policy, a stark contrast to the other Group of Seven central banks. The Tankan doesn’t change that.  

It’s entirely possible that population decline explains at least part of the boost to corporate capital plans. If the country’s pool of labor is dwindling, employers face of the choice of hiring from abroad or investing more in robots and other forms of artificial intelligence. Immigration is a bit of a third rail in parts of Japan. On a December 2016 visit to Kadoma, a city near Osaka that was once an industrial powerhouse, several employers told me they would rather have robots than foreign workers. I didn’t hear one manager say they favored immigration over machines as a way to overcome labor shortages.  

As that visit attested, the desire to spend more on robots isn’t something suddenly bursting on the scene. It may be part of the investment surge, but not all of it.

The strong numbers are even more mysterious given the context of global fears about trade war between the U.S. and China. (And between the U.S. and everyone else.) If that is such a threat, the outlook for corporate Japan would be dire. But the numbers don’t show a collapse in sentiment. Perhaps the hit to growth would not be as great as feared.   

Economic isolationism also cannot explain Japan’s strong numbers at this moment. The nation is no longer a free-trade recalcitrant. Japan was a leader in reviving the Trans-Pacific Partnership sans America. Separately, Asian trade ministers met in Tokyo this week in an effort to fashion what could be the world’s biggest trading bloc — including China but, again, without the U.S.

Whatever the motivation for capital investment, the unwillingness of companies to cower at today’s trade tussles is a refreshing note of optimism. Good for Japan.