That said, modern China is a pragmatic country whose primary focus is to keep its own population happy. China has a lot of hurdles in the path to the realization of that goal, and needs the economy of the region to stay stable for that. If China attacks India (or vice versa), global supply chains and economies will get severly affected and in turn will have an avalanche effect on the economies of both the countries. Hence, practically speaking, neither countries would wage war on each other unless taken over by a whimsical, dicatatorial leader (and which dictator isn't whimsical?).