But the question is also isn't it late in the day to be investing in a new Flanker variant with the rise of the fifth generation fighters all over the world. The US has the F-22 and the F-35, the Russians with their SU-PAK FA and China with its own stealth fighter programs the J-20 and the J-31. Not to mention that the allies of the US including Japan and South Korea are getting the F-35 and the Indians are getting their specialized version of the SU-PAK FA. On top of that Japan, India and South Korea are all trying to build their own stealth fighters aside from their imports. Is the Flanker not an outdated platform and China should focus its resources on the J-20 and perhabs the J-31 ?
You're making the assumptions that 1. all combat roles should be filled by stealth fighters and 2. highly up-graded 4th generation fighters cannot meaningfully contribute to a fight in which an adversary uses stealth aircraft.
1. stealth fighters are greatly limited in carrying capacity (at least in stealth configuration) so if you need a jet to haul and launch a huge anti-shipping missile without being an absolute sitting duck should anything go wrong, a heavily upgraded 4th generation fighter with great maneuverability, range, and payload and a powerful radar is perfect. Using H-6 would almost guarantee that you'd lose it if an enemy fighter got on it and using J-20 would be pointlessly expensive since it'd have to carry the missile externally and lose stealth.
2. Technologies for making it easier to track stealth fighters are rapidly evolving. A 4th generation fighter with excellent aerodynamic performance, highly modern AESA radar, and IRST, data-linked with other similar fighters, allied stealth fighters, and a powerful AWAC can give enemy stealth fighters, especially lower-end or budget stealth fighters, a big run for their money.