(1) Subject to the other provisions of this Sanhita, the powers and duties of a Judge or Magistrate may be exercised or performed by his successor-in-office. (2) When there is any doubt as to who is the successor-in-office, the Sessions Judge shall determine by order in writing the Judge who shall, for the purposes of this Sanhita or of any proceedings or order thereunder, be deemed to be the successor-in-office. (3) When there is any doubt as to who is the successor-in-office of any Magistrate, the Chief Judicial Magistrate, or the District Magistrate, as the case may be, shall determine by order in writing the Magistrate who shall, for the purpose of this Sanhita or of any proceedings or order thereunder, be deemed to be the successor-in-office of such Magistrate.