Skip to content

Commit

Permalink
FORGE-1704: temporary workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Mar 28, 2014
1 parent 6a68988 commit eb4e324
Showing 1 changed file with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
import org.jboss.forge.furnace.addons.AddonRegistry;

/**
*
*
* Implementation for the {@link WizardCommandController} interface
*
*
* @author <a href="ggastald@redhat.com">George Gastaldi</a>
*/
class WizardCommandControllerImpl extends AbstractCommandController implements WizardCommandController
Expand Down Expand Up @@ -386,21 +386,30 @@ public WizardCommandController next() throws Exception
}

/**
*
* Remove stale pages in case of navigational changes
*/
private void cleanSubsequentStalePages()
{
// Remove subsequent pages and push the subflows back to the stack
Iterator<WizardStepEntry> it = flow.listIterator(flowPointer + 1);
int subflowIdx = 0;
while (it.hasNext())
// FIXME: Workaround until FORGE-1704 is fixed
if (flowPointer == 0)
{
WizardStepEntry entry = it.next();
if (entry.subflowHead && !subflow.contains(entry))
flow.subList(1, flow.size()).clear();
subflow.clear();
}
else
{
// Remove subsequent pages and push the subflows back to the stack
Iterator<WizardStepEntry> it = flow.listIterator(flowPointer + 1);
int subflowIdx = 0;
while (it.hasNext())
{
subflow.add(subflowIdx++, entry);
WizardStepEntry entry = it.next();
if (entry.subflowHead && !subflow.contains(entry))
{
subflow.add(subflowIdx++, entry);
}
it.remove();
}
it.remove();
}
}

Expand Down

0 comments on commit eb4e324

Please sign in to comment.