+ throw new Error(String.format(
+ "Progress object %s cannot have a weight of %f, "
+ + "it is outside of its parent (%s) range (%f)",
+ progress.name, weight, name, max));
+ }
+
+ if (progress.parent != null) {
+ throw new Error(String.format(
+ "Progress object %s cannot be added to %s, "
+ + "as it already has a parent (%s)", progress.name,
+ name, progress.parent.name));