Program: 47481
Project: 47481
Buggy source:
private void showPerspective(final ToggleButton source,final IPluginPerspective perspective){
  Widget w=MantleApplication.getInstance().getContentDeck().getWidget(MantleApplication.getInstance().getContentDeck().getVisibleWidget());
  if (w instanceof Frame && !perspective.getId().equals(w.getElement().getId())) {
    Frame frame=(Frame)w;
    perspectiveDeactivated(frame.getElement());
  }
  final IPluginPerspective defaultPerspective=perspectives.get(0);
  for (  ToggleButton disableMe : toggles) {
    if (disableMe != source) {
      disableMe.setDown(false);
    }
  }
  if (activePerspective != null) {
    for (    XulOverlay o : activePerspective.getOverlays()) {
      if (!o.getId().startsWith("String_Node_Str") && !o.getId().startsWith("String_Node_Str")) {
        MantleXul.getInstance().removeOverlay(o.getId());
      }
    }
    for (    XulOverlay overlay : MantleXul.getInstance().getOverlays()) {
      if (overlay.getId().startsWith(activePerspective.getId() + "String_Node_Str")) {
        MantleXul.getInstance().removeOverlay(overlay.getId());
      }
    }
  }
  this.activePerspective=perspective;
  if (source.isDown() && perspective.getOverlays() != null) {
    for (    XulOverlay overlay : perspective.getOverlays()) {
      if (!overlay.getId().startsWith("String_Node_Str") && !overlay.getId().startsWith("String_Node_Str")) {
        MantleXul.getInstance().applyOverlay(overlay.getId());
      }
    }
    for (    XulOverlay overlay : MantleXul.getInstance().getOverlays()) {
      if (overlay.getId().startsWith(perspective.getId() + "String_Node_Str")) {
        MantleXul.getInstance().applyOverlay(overlay.getId());
      }
    }
  }
 else   if (!source.isDown() && defaultPerspective.getOverlays() != null) {
    for (    XulOverlay overlay : defaultPerspective.getOverlays()) {
      if (!overlay.getId().startsWith("String_Node_Str") && !overlay.getId().startsWith("String_Node_Str")) {
        MantleXul.getInstance().applyOverlay(overlay.getId());
      }
    }
    for (    XulOverlay overlay : MantleXul.getInstance().getOverlays()) {
      if (overlay.getId().startsWith(defaultPerspective.getId() + "String_Node_Str")) {
        MantleXul.getInstance().applyOverlay(overlay.getId());
      }
    }
  }
  if (source.isDown() && !perspective.getId().equals(DEFAULT_PERSPECTIVE) && !perspective.getId().equals(WORKSPACE_PERSPECTIVE)&& !perspective.getId().equals(ADMIN_PERSPECTIVE)) {
    hijackContentArea(perspective);
  }
  if (!source.isDown()) {
    toggles.get(0).setDown(true);
    if (defaultPerspective.getId().equals(DEFAULT_PERSPECTIVE)) {
      showDefaultPerspective();
      return;
    }
  }
  if (perspective.getId().equals(DEFAULT_PERSPECTIVE)) {
    showDefaultPerspective();
  }
 else   if (perspective.getId().equals(WORKSPACE_PERSPECTIVE)) {
    showWorkspacePerspective();
  }
 else   if (perspective.getId().equals(ADMIN_PERSPECTIVE)) {
    showAdminPerspective();
  }
}

Fixed version (ground truth):
private void showPerspective(final ToggleButton source,final IPluginPerspective perspective){
  Widget w=MantleApplication.getInstance().getContentDeck().getWidget(MantleApplication.getInstance().getContentDeck().getVisibleWidget());
  if (w instanceof Frame && !perspective.getId().equals(w.getElement().getId())) {
    Frame frame=(Frame)w;
    perspectiveDeactivated(frame.getElement());
  }
  final IPluginPerspective defaultPerspective=perspectives.get(0);
  for (  ToggleButton disableMe : toggles) {
    if (disableMe != source) {
      disableMe.setDown(false);
    }
  }
  if (activePerspective != null) {
    for (    XulOverlay o : activePerspective.getOverlays()) {
      if (!o.getId().startsWith("String_Node_Str") && !o.getId().startsWith("String_Node_Str")) {
        MantleXul.getInstance().removeOverlay(o.getId());
      }
    }
    for (    XulOverlay overlay : MantleXul.getInstance().getOverlays()) {
      if (overlay.getId().startsWith(activePerspective.getId() + "String_Node_Str")) {
        MantleXul.getInstance().removeOverlay(overlay.getId());
      }
    }
  }
  this.activePerspective=perspective;
  if (source.isDown() && perspective.getOverlays() != null) {
    for (    XulOverlay overlay : perspective.getOverlays()) {
      if (!overlay.getId().startsWith("String_Node_Str") && !overlay.getId().startsWith("String_Node_Str")) {
        MantleXul.getInstance().applyOverlay(overlay.getId());
      }
    }
    for (    XulOverlay overlay : MantleXul.getInstance().getOverlays()) {
      if (overlay.getId().startsWith(perspective.getId() + "String_Node_Str")) {
        MantleXul.getInstance().applyOverlay(overlay.getId());
      }
    }
  }
 else   if (!source.isDown() && defaultPerspective.getOverlays() != null) {
    for (    XulOverlay overlay : defaultPerspective.getOverlays()) {
      if (!overlay.getId().startsWith("String_Node_Str") && !overlay.getId().startsWith("String_Node_Str")) {
        MantleXul.getInstance().applyOverlay(overlay.getId());
      }
    }
    for (    XulOverlay overlay : MantleXul.getInstance().getOverlays()) {
      if (overlay.getId().startsWith(defaultPerspective.getId() + "String_Node_Str")) {
        MantleXul.getInstance().applyOverlay(overlay.getId());
      }
    }
  }
  if (source.isDown() && !perspective.getId().equals(DEFAULT_PERSPECTIVE) && !perspective.getId().equals(WORKSPACE_PERSPECTIVE)&& !perspective.getId().equals(ADMIN_PERSPECTIVE)) {
    hijackContentArea(perspective);
  }
  if (!source.isDown()) {
    toggles.get(0).setDown(true);
    if (defaultPerspective.getId().equals(DEFAULT_PERSPECTIVE)) {
      showDefaultPerspective(true,false);
      return;
    }
  }
  if (perspective.getId().equals(DEFAULT_PERSPECTIVE)) {
    showDefaultPerspective(true,false);
  }
 else   if (perspective.getId().equals(WORKSPACE_PERSPECTIVE)) {
    showWorkspacePerspective(false,true);
  }
 else   if (perspective.getId().equals(ADMIN_PERSPECTIVE)) {
    showAdminPerspective(false,false);
  }
}