Program: 99213
Project: 99213
Buggy source:
public void updateTuioCursor(TuioCursor tcur){
  int x=tcur.getScreenX(p.width);
  int y=tcur.getScreenY(p.height);
  for (  Map map : maps) {
    if (map.isHit(x,y)) {
      if (tuioCursor1 != null && tuioCursor2 != null) {
        boolean zoom=true;
        boolean rotate=true;
        PVector transCenter=new PVector();
        if (tuioCursor2.getCursorID() == tcur.getCursorID()) {
          transCenter.x=tuioCursor1.getScreenX(p.width);
          transCenter.y=tuioCursor1.getScreenY(p.height);
        }
 else {
          transCenter.x=tuioCursor2.getScreenX(p.width);
          transCenter.y=tuioCursor2.getScreenY(p.height);
        }
        if (zoom) {
          map.mapDisplay.setInnerTransformationCenter(transCenter);
          float newDist=getDistance(tuioCursor1,tuioCursor2);
          float scaleDelta=newDist / oldDist;
          oldDist=newDist;
          map.zoom(scaleDelta);
        }
        if (rotate) {
          map.mapDisplay.setTransformationCenter(transCenter);
          float newAngle=getAngleBetween(tuioCursor1,tuioCursor2);
          float angle=newAngle - oldAngle;
          oldAngle=newAngle;
          map.rotate(angle);
        }
      }
 else       if (tuioCursor1 != null) {
        Location fromLocation=map.mapDisplay.getLocationFromScreenPosition(oldX,oldY);
        Location toLocation=map.mapDisplay.getLocationFromScreenPosition(x,y);
        PanMapEvent panMapEvent=new PanMapEvent(this,map.getId(),PanMapEvent.PAN_BY);
        panMapEvent.setFromLocation(fromLocation);
        panMapEvent.setToLocation(toLocation);
        eventDispatcher.fireMapEvent(panMapEvent);
        oldX=x;
        oldY=y;
      }
    }
  }
}

Fixed version (ground truth):
public void updateTuioCursor(TuioCursor tcur){
  int x=tcur.getScreenX(p.width);
  int y=tcur.getScreenY(p.height);
  for (  Map map : maps) {
    if (map.isHit(x,y)) {
      if (tuioCursor1 != null && tuioCursor2 != null) {
        boolean zoom=true;
        boolean rotate=true;
        PVector transCenter=new PVector();
        if (tuioCursor2.getCursorID() == tcur.getCursorID()) {
          transCenter.x=tuioCursor1.getScreenX(p.width);
          transCenter.y=tuioCursor1.getScreenY(p.height);
        }
 else {
          transCenter.x=tuioCursor2.getScreenX(p.width);
          transCenter.y=tuioCursor2.getScreenY(p.height);
        }
        if (zoom) {
          map.mapDisplay.setInnerTransformationCenter(transCenter);
          float newDist=getDistance(tuioCursor1,tuioCursor2);
          float scaleDelta=newDist / oldDist;
          oldDist=newDist;
          map.zoom(scaleDelta);
        }
        if (rotate) {
          map.mapDisplay.setTransformationCenter(transCenter);
          float newAngle=getAngleBetween(tuioCursor1,tuioCursor2);
          float angle=newAngle - oldAngle;
          oldAngle=newAngle;
          map.rotate(angle);
        }
      }
 else       if (tuioCursor1 != null) {
        if (tuioCursor1.getCursorID() == tcur.getCursorID()) {
          Location fromLocation=map.mapDisplay.getLocationFromScreenPosition(oldX,oldY);
          Location toLocation=map.mapDisplay.getLocationFromScreenPosition(x,y);
          PanMapEvent panMapEvent=new PanMapEvent(this,map.getId(),PanMapEvent.PAN_BY);
          panMapEvent.setFromLocation(fromLocation);
          panMapEvent.setToLocation(toLocation);
          eventDispatcher.fireMapEvent(panMapEvent);
          oldX=x;
          oldY=y;
        }
      }
    }
  }
}