Program: 177295
Project: 177295
Buggy source:
/** 
 * Updates CollisionObjects in this region and adds/removes them from the simulation.  Steps simulation forward and finally alerts the API in components.
 * @param dt
 */
private void updateDynamics(float dt){
  try {
synchronized (simulation) {
      simulation.stepSimulation(dt / 1000,2);
      final Dispatcher dispatcher=simulation.getDispatcher();
      int manifolds=dispatcher.getNumManifolds();
      for (int i=0; i < manifolds; i++) {
        PersistentManifold contact=dispatcher.getManifoldByIndexInternal(i);
        Object colliderRawA=contact.getBody0();
        Object colliderRawB=contact.getBody1();
        if (!(colliderRawA instanceof CollisionObject) || !(colliderRawB instanceof CollisionObject)) {
          continue;
        }
        Object holderA=((CollisionObject)colliderRawA).getUserPointer();
        Object holderB=((CollisionObject)colliderRawB).getUserPointer();
        int contacts=contact.getNumContacts();
        for (int j=0; j < contacts; j++) {
          final ManifoldPoint bulletPoint=contact.getContactPoint(j);
          if (bulletPoint.getDistance() > 0f) {
            continue;
          }
          Point contactPointA=new Point(MathHelper.toVector3(bulletPoint.getPositionWorldOnA(new Vector3f())),getWorld());
          Point contactPointB=new Point(MathHelper.toVector3(bulletPoint.getPositionWorldOnB(new Vector3f())),getWorld());
          if (holderA instanceof Entity) {
            if (((Entity)holderA).isRemoved()) {
              break;
            }
            if (holderB instanceof Entity) {
              if (((Entity)holderB).isRemoved()) {
                break;
              }
              for (              Component component : ((Entity)holderA).values()) {
                if (component instanceof EntityComponent) {
                  ((EntityComponent)component).onCollided(contactPointA,contactPointB,(Entity)holderB);
                }
              }
              for (              Component component : ((Entity)holderB).values()) {
                if (component instanceof EntityComponent) {
                  ((EntityComponent)component).onCollided(contactPointB,contactPointA,(Entity)holderA);
                }
              }
            }
 else             if (holderB instanceof Block) {
              for (              Component component : ((Entity)holderA).values()) {
                if (component instanceof EntityComponent) {
                  ((EntityComponent)component).onCollided(contactPointA,contactPointB,(Block)holderB);
                }
              }
              ((Block)holderB).getMaterial().onCollided(contactPointB,contactPointA,(Entity)holderA);
            }
          }
 else           if (holderA instanceof Block) {
            if (holderB instanceof Entity) {
              if (((Entity)holderB).isRemoved()) {
                break;
              }
              ((Block)holderA).getMaterial().onCollided(contactPointA,contactPointB,(Entity)holderB);
              for (              Component component : ((Entity)holderB).values()) {
                if (component instanceof EntityComponent) {
                  ((EntityComponent)component).onCollided(contactPointB,contactPointA,(Block)holderA);
                }
              }
            }
          }
        }
      }
    }
  }
 catch (  Exception e) {
synchronized (logLock) {
      Spout.getLogger().log(Level.SEVERE,"String_Node_Str" + getBase().toBlockString(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates CollisionObjects in this region and adds/removes them from the simulation.  Steps simulation forward and finally alerts the API in components.
 * @param dt
 */
private void updateDynamics(float dt){
  try {
synchronized (simulation) {
      simulation.stepSimulation(dt,2);
      final Dispatcher dispatcher=simulation.getDispatcher();
      int manifolds=dispatcher.getNumManifolds();
      for (int i=0; i < manifolds; i++) {
        PersistentManifold contact=dispatcher.getManifoldByIndexInternal(i);
        Object colliderRawA=contact.getBody0();
        Object colliderRawB=contact.getBody1();
        if (!(colliderRawA instanceof CollisionObject) || !(colliderRawB instanceof CollisionObject)) {
          continue;
        }
        Object holderA=((CollisionObject)colliderRawA).getUserPointer();
        Object holderB=((CollisionObject)colliderRawB).getUserPointer();
        int contacts=contact.getNumContacts();
        for (int j=0; j < contacts; j++) {
          final ManifoldPoint bulletPoint=contact.getContactPoint(j);
          if (bulletPoint.getDistance() > 0f) {
            continue;
          }
          Point contactPointA=new Point(MathHelper.toVector3(bulletPoint.getPositionWorldOnA(new Vector3f())),getWorld());
          Point contactPointB=new Point(MathHelper.toVector3(bulletPoint.getPositionWorldOnB(new Vector3f())),getWorld());
          if (holderA instanceof Entity) {
            if (((Entity)holderA).isRemoved()) {
              break;
            }
            if (holderB instanceof Entity) {
              if (((Entity)holderB).isRemoved()) {
                break;
              }
              for (              Component component : ((Entity)holderA).values()) {
                if (component instanceof EntityComponent) {
                  ((EntityComponent)component).onCollided(contactPointA,contactPointB,(Entity)holderB);
                }
              }
              for (              Component component : ((Entity)holderB).values()) {
                if (component instanceof EntityComponent) {
                  ((EntityComponent)component).onCollided(contactPointB,contactPointA,(Entity)holderA);
                }
              }
            }
 else             if (holderB instanceof Block) {
              for (              Component component : ((Entity)holderA).values()) {
                if (component instanceof EntityComponent) {
                  ((EntityComponent)component).onCollided(contactPointA,contactPointB,(Block)holderB);
                }
              }
              ((Block)holderB).getMaterial().onCollided(contactPointB,contactPointA,(Entity)holderA);
            }
          }
 else           if (holderA instanceof Block) {
            if (holderB instanceof Entity) {
              if (((Entity)holderB).isRemoved()) {
                break;
              }
              ((Block)holderA).getMaterial().onCollided(contactPointA,contactPointB,(Entity)holderB);
              for (              Component component : ((Entity)holderB).values()) {
                if (component instanceof EntityComponent) {
                  ((EntityComponent)component).onCollided(contactPointB,contactPointA,(Block)holderA);
                }
              }
            }
          }
        }
      }
    }
  }
 catch (  Exception e) {
synchronized (logLock) {
      Spout.getLogger().log(Level.SEVERE,"String_Node_Str" + getBase().toBlockString(),e);
    }
  }
}