Restoring state before java part begins