static void restoreFromHistory ( final InstallationManager . MutablePatchingTarget target , final String rollbackPatchId , final Patch . PatchType patchType , final PatchableTarget . TargetInfo history ) throws PatchingException { if ( patchType == Patch . PatchType . CUMULATIVE ) { assert history . getCumulativePatchID ( ) . equals ( rollbackPatchId ) ; target . apply ( rollbackPatchId , patchType ) ; // Restore one off state final List < String > oneOffs = new ArrayList < String > ( history . getPatchIDs ( ) ) ; Collections . reverse ( oneOffs ) ; for ( final String oneOff : oneOffs ) { target . apply ( oneOff , Patch . PatchType . ONE_OFF ) ; } } checkState ( history , history ) ; // Just check for tests, that rollback should restore the old state }
Restore the recorded state from the rollback xml .