Program: 90995
Project: 90995
Buggy source:
public void mouseOverHighlight(final int x,final int y){
  final AffineTransform3D transform=new AffineTransform3D();
synchronized (renderTransform) {
    transform.set(renderTransform);
  }
  final int currentTimepoint=viewer.getState().getCurrentTimepoint();
  final double[] lPos=new double[]{x,y,0};
  final double[] gPos=new double[3];
  final ScreenVertexMath svm=new ScreenVertexMath(nSigmas);
  transform.applyInverse(gPos,lPos);
  final SpatioTemporalIndex<V> index=graph.getIndex();
  index.readLock().lock();
  try {
    if (drawSliceIntersection) {
      final NearestNeighborSearch<V> nns=index.getSpatialIndex(currentTimepoint).getNearestNeighborSearch();
      nns.search(RealPoint.wrap(gPos));
      final V v=nns.getSampler().get();
      if (v != null) {
        svm.init(v,transform);
        if (svm.containsGlobal(gPos)) {
          highlight.highlightVertex(v);
          return;
        }
      }
    }
 else {
      final double globalToViewerScale=Affine3DHelpers.extractScale(transform,0);
      final double border=globalToViewerScale * Math.sqrt(graph.getMaxBoundingSphereRadiusSquared(currentTimepoint));
      final ConvexPolytope cropPolytopeViewer=new ConvexPolytope(new HyperPlane(0,0,1,-focusLimit),new HyperPlane(0,0,-1,-focusLimit),new HyperPlane(1,0,0,x - border),new HyperPlane(-1,0,0,-x - border),new HyperPlane(0,1,0,y - border),new HyperPlane(0,-1,0,-y - border));
      final ConvexPolytope cropPolytopeGlobal=ConvexPolytope.transform(cropPolytopeViewer,transform.inverse());
      final ClipConvexPolytope<V> ccp=index.getSpatialIndex(currentTimepoint).getClipConvexPolytope();
      ccp.clip(cropPolytopeGlobal);
      final double[] xy=new double[]{x,y};
      final double[] vPos=new double[3];
      double minDist=Double.MAX_VALUE;
      final V minV=graph.vertexRef();
      boolean found=false;
      for (      final V v : ccp.getInsideValues()) {
        svm.init(v,transform);
        if (svm.projectionContainsView(xy)) {
          v.localize(vPos);
          final double d=LinAlgHelpers.squareDistance(vPos,gPos);
          if (d < minDist) {
            minDist=d;
            minV.refTo(v);
          }
        }
        found=true;
      }
      if (found) {
        highlight.highlightVertex(minV);
        graph.releaseRef(minV);
        return;
      }
      graph.releaseRef(minV);
    }
  }
  finally {
    index.readLock().unlock();
  }
  highlight.highlightVertex(null);
}

Fixed version (ground truth):
public void mouseOverHighlight(final int x,final int y){
  final AffineTransform3D transform=new AffineTransform3D();
synchronized (renderTransform) {
    transform.set(renderTransform);
  }
  final int currentTimepoint=viewer.getState().getCurrentTimepoint();
  final double[] lPos=new double[]{x,y,0};
  final double[] gPos=new double[3];
  final ScreenVertexMath svm=new ScreenVertexMath(nSigmas);
  transform.applyInverse(gPos,lPos);
  final SpatioTemporalIndex<V> index=graph.getIndex();
  index.readLock().lock();
  try {
    if (drawSliceIntersection) {
      final NearestNeighborSearch<V> nns=index.getSpatialIndex(currentTimepoint).getNearestNeighborSearch();
      nns.search(RealPoint.wrap(gPos));
      final V v=nns.getSampler().get();
      if (v != null) {
        svm.init(v,transform);
        if (svm.containsGlobal(gPos)) {
          highlight.highlightVertex(v);
          return;
        }
      }
    }
 else {
      final double globalToViewerScale=Affine3DHelpers.extractScale(transform,0);
      final double border=globalToViewerScale * Math.sqrt(graph.getMaxBoundingSphereRadiusSquared(currentTimepoint));
      final ConvexPolytope cropPolytopeViewer=new ConvexPolytope(new HyperPlane(0,0,1,-focusLimit),new HyperPlane(0,0,-1,-focusLimit),new HyperPlane(1,0,0,x - border),new HyperPlane(-1,0,0,-x - border),new HyperPlane(0,1,0,y - border),new HyperPlane(0,-1,0,-y - border));
      final ConvexPolytope cropPolytopeGlobal=ConvexPolytope.transform(cropPolytopeViewer,transform.inverse());
      final ClipConvexPolytope<V> ccp=index.getSpatialIndex(currentTimepoint).getClipConvexPolytope();
      ccp.clip(cropPolytopeGlobal);
      final double[] xy=new double[]{x,y};
      final double[] vPos=new double[3];
      double minDist=Double.MAX_VALUE;
      final V minV=graph.vertexRef();
      boolean found=false;
      for (      final V v : ccp.getInsideValues()) {
        svm.init(v,transform);
        if (svm.projectionContainsView(xy)) {
          found=true;
          v.localize(vPos);
          final double d=LinAlgHelpers.squareDistance(vPos,gPos);
          if (d < minDist) {
            minDist=d;
            minV.refTo(v);
          }
        }
      }
      if (found) {
        highlight.highlightVertex(minV);
        graph.releaseRef(minV);
        return;
      }
      graph.releaseRef(minV);
    }
  }
  finally {
    index.readLock().unlock();
  }
  highlight.highlightVertex(null);
}