Faced with so many prophecies of judgement and calamity, Josiah chose the wise course of action and repented, with the result that God said (through the prophet Huldah):
2 Chronicles 34:27-28 You were sorry and humbled yourself before God when you heard his words against this city and its people. You humbled yourself and tore your clothing in despair and wept before me in repentance. And I have indeed heard you, says the Lord. So I will not send the promised disaster until after you have died and been buried in peace. You yourself will not see the disaster I am going to bring on this city and its people.