Program: 90897
Project: 90897
Buggy source:
public TrackSchemePanel(final TrackSchemeGraph<?,?> graph,final TrackSchemeHighlight highlight,final TrackSchemeFocus focus,final TrackSchemeSelection selection,final TrackSchemeNavigation navigation,final TrackSchemeOptions optional){
  super(new BorderLayout(),false);
  this.graph=graph;
  this.focus=focus;
  final Values options=optional.values;
  graph.addGraphChangeListener(this);
  navigation.addNavigationListener(this);
  final int w=options.getWidth();
  final int h=options.getHeight();
  display=new InteractiveDisplayCanvasComponent<ScreenTransform>(w,h,options.getTransformEventHandlerFactory());
  display.addTransformListener(this);
  highlight.addHighlightListener(this);
  focus.addFocusListener(this);
  selection.addSelectionListener(this);
  style=TrackSchemeStyle.defaultStyle();
  graphOverlay=new DefaultTrackSchemeOverlay(graph,highlight,focus,optional,style);
  display.addOverlayRenderer(graphOverlay);
  display.addOverlayRenderer(new OverlayRenderer(){
    @Override public void setCanvasSize(    final int width,    final int height){
    }
    @Override public void drawOverlays(    final Graphics g){
      checkAnimate();
    }
  }
);
  screenTransform=new ScreenTransform();
  layout=new LineageTreeLayout(graph);
  contextLayout=new ContextLayout(graph,layout);
  final TransformEventHandler<ScreenTransform> tevl=display.getTransformEventHandler();
  if (tevl instanceof LayoutListener) {
    final LayoutListener ll=(LayoutListener)tevl;
    layout.addLayoutListener(ll);
  }
  entityAnimator=new ScreenEntityAnimator();
  painterThread=new PainterThread(this);
  flags=new Flags();
  final MouseHighlightHandler highlightHandler=new MouseHighlightHandler(graphOverlay,highlight,graph);
  display.addMouseMotionListener(highlightHandler);
  display.addMouseListener(highlightHandler);
  display.addTransformListener(highlightHandler);
  navigator=new TrackSchemeNavigator(graph,layout,focus,navigation,selection);
  display.addTransformListener(navigator);
  selectionBehaviours=new SelectionBehaviours(display,graph,layout,graphOverlay,focus,navigation,selection);
  display.addTransformListener(selectionBehaviours);
  offsetHeaders=new OffsetHeaders();
  offsetHeaders.addOffsetHeadersListener((InertialScreenTransformEventHandler)display.getTransformEventHandler());
  offsetHeaders.addOffsetHeadersListener(graphOverlay);
  offsetHeaders.addOffsetHeadersListener(selectionBehaviours);
  offsetHeaders.addOffsetHeadersListener(highlightHandler);
  offsetHeaders.setHeaderVisibleX(true,25);
  offsetHeaders.setHeaderVisibleY(true,20);
  xScrollBar=new JScrollBar(JScrollBar.HORIZONTAL);
  yScrollBar=new JScrollBar(JScrollBar.VERTICAL);
  xScrollBar.addAdjustmentListener(new AdjustmentListener(){
    @Override public void adjustmentValueChanged(    final AdjustmentEvent e){
      if (ignoreScrollBarChanges)       return;
      final double s=xScrollBar.getValue() / xScrollScale;
synchronized (screenTransform) {
        screenTransform.shiftLayoutX(s - screenTransform.getMinX());
        display.getTransformEventHandler().setTransform(screenTransform);
      }
      flags.setTransformChanged();
      painterThread.requestRepaint();
    }
  }
);
  yScrollBar.addAdjustmentListener(new AdjustmentListener(){
    @Override public void adjustmentValueChanged(    final AdjustmentEvent e){
      if (ignoreScrollBarChanges)       return;
      final double s=yScrollBar.getValue() / yScrollScale;
synchronized (screenTransform) {
        screenTransform.shiftLayoutY(s - screenTransform.getMinY());
        display.getTransformEventHandler().setTransform(screenTransform);
      }
      flags.setTransformChanged();
      painterThread.requestRepaint();
    }
  }
);
  add(display,BorderLayout.CENTER);
  add(yScrollBar,BorderLayout.EAST);
  final JPanel xScrollPanel=new JPanel(new BorderLayout());
  xScrollPanel.add(xScrollBar,BorderLayout.CENTER);
  final int space=(Integer)UIManager.getDefaults().get("String_Node_Str");
  xScrollPanel.add(Box.createRigidArea(new Dimension(space,0)),BorderLayout.EAST);
  add(xScrollPanel,BorderLayout.SOUTH);
  setNavigationEtiquette(options.getNavigationEtiquette());
  painterThread.start();
}

Fixed version (ground truth):
public TrackSchemePanel(final TrackSchemeGraph<?,?> graph,final TrackSchemeHighlight highlight,final TrackSchemeFocus focus,final TrackSchemeSelection selection,final TrackSchemeNavigation navigation,final TrackSchemeOptions optional){
  super(new BorderLayout(),false);
  this.graph=graph;
  this.focus=focus;
  final Values options=optional.values;
  graph.addGraphChangeListener(this);
  navigation.addNavigationListener(this);
  final int w=options.getWidth();
  final int h=options.getHeight();
  display=new InteractiveDisplayCanvasComponent<>(w,h,options.getTransformEventHandlerFactory());
  display.addTransformListener(this);
  highlight.addHighlightListener(this);
  focus.addFocusListener(this);
  selection.addSelectionListener(this);
  style=TrackSchemeStyle.defaultStyle().copy("String_Node_Str");
  graphOverlay=new DefaultTrackSchemeOverlay(graph,highlight,focus,optional,style);
  display.addOverlayRenderer(graphOverlay);
  display.addOverlayRenderer(new OverlayRenderer(){
    @Override public void setCanvasSize(    final int width,    final int height){
    }
    @Override public void drawOverlays(    final Graphics g){
      checkAnimate();
    }
  }
);
  screenTransform=new ScreenTransform();
  layout=new LineageTreeLayout(graph);
  contextLayout=new ContextLayout(graph,layout);
  final TransformEventHandler<ScreenTransform> tevl=display.getTransformEventHandler();
  if (tevl instanceof LayoutListener) {
    final LayoutListener ll=(LayoutListener)tevl;
    layout.addLayoutListener(ll);
  }
  entityAnimator=new ScreenEntityAnimator();
  painterThread=new PainterThread(this);
  flags=new Flags();
  final MouseHighlightHandler highlightHandler=new MouseHighlightHandler(graphOverlay,highlight,graph);
  display.addMouseMotionListener(highlightHandler);
  display.addMouseListener(highlightHandler);
  display.addTransformListener(highlightHandler);
  navigator=new TrackSchemeNavigator(graph,layout,focus,navigation,selection);
  display.addTransformListener(navigator);
  selectionBehaviours=new SelectionBehaviours(display,graph,layout,graphOverlay,focus,navigation,selection);
  display.addTransformListener(selectionBehaviours);
  offsetHeaders=new OffsetHeaders();
  offsetHeaders.addOffsetHeadersListener((InertialScreenTransformEventHandler)display.getTransformEventHandler());
  offsetHeaders.addOffsetHeadersListener(graphOverlay);
  offsetHeaders.addOffsetHeadersListener(selectionBehaviours);
  offsetHeaders.addOffsetHeadersListener(highlightHandler);
  offsetHeaders.setHeaderVisibleX(true,25);
  offsetHeaders.setHeaderVisibleY(true,20);
  xScrollBar=new JScrollBar(JScrollBar.HORIZONTAL);
  yScrollBar=new JScrollBar(JScrollBar.VERTICAL);
  xScrollBar.addAdjustmentListener(new AdjustmentListener(){
    @Override public void adjustmentValueChanged(    final AdjustmentEvent e){
      if (ignoreScrollBarChanges)       return;
      final double s=xScrollBar.getValue() / xScrollScale;
synchronized (screenTransform) {
        screenTransform.shiftLayoutX(s - screenTransform.getMinX());
        display.getTransformEventHandler().setTransform(screenTransform);
      }
      flags.setTransformChanged();
      painterThread.requestRepaint();
    }
  }
);
  yScrollBar.addAdjustmentListener(new AdjustmentListener(){
    @Override public void adjustmentValueChanged(    final AdjustmentEvent e){
      if (ignoreScrollBarChanges)       return;
      final double s=yScrollBar.getValue() / yScrollScale;
synchronized (screenTransform) {
        screenTransform.shiftLayoutY(s - screenTransform.getMinY());
        display.getTransformEventHandler().setTransform(screenTransform);
      }
      flags.setTransformChanged();
      painterThread.requestRepaint();
    }
  }
);
  add(display,BorderLayout.CENTER);
  add(yScrollBar,BorderLayout.EAST);
  final JPanel xScrollPanel=new JPanel(new BorderLayout());
  xScrollPanel.add(xScrollBar,BorderLayout.CENTER);
  final int space=(Integer)UIManager.getDefaults().get("String_Node_Str");
  xScrollPanel.add(Box.createRigidArea(new Dimension(space,0)),BorderLayout.EAST);
  add(xScrollPanel,BorderLayout.SOUTH);
  setNavigationEtiquette(options.getNavigationEtiquette());
  painterThread.start();
}