It's the type of the arguments that causes a loop. The other generate functions use the enum Type. Furthermore there are no types defined as int anymore.
I use this function now:
public static void generateCollisionTree(CollisionTree.Type type,
Spatial mesh, boolean protect) {
if (mesh instanceof TriMesh)
CollisionTreeManager.getInstance().generateCollisionTree(type, (TriMesh)mesh, protect);
if (mesh instanceof Node) {
for (Spatial sp : ((Node)mesh).getChildren())
generateCollisionTree(type, sp, protect);
}
}