logger.error("Sizer: invalid quantity unit specified - " + quantityUnit + " - assuming TONS.");
if (logger.isErrorEnabled()) { logger.error("Sizer: invalid quantity unit specified - " + quantityUnit + " - assuming TONS."); }
  public static Mass getTaskMass(Task task, int quantityUnit) {    switch (quantityUnit) {      case (EACHES):        GLMAsset assetToBePacked = (GLMAsset) task.getDirectObject();        if (assetToBePacked.hasPhysicalPG()) {          Mass massPerEach = assetToBePacked.getPhysicalPG().getMass();          double taskWeight = task.getPreferredValue(AspectType.QUANTITY) *              massPerEach.getShortTons();          return new Mass(taskWeight, Mass.SHORT_TONS);        } else {          if (logger.isDebugEnabled()) {            logger.debug("Sizer.getTaskMass: asset - " +                         assetToBePacked +                         " - does not have a PhysicalPG. " +                         "Assuming QUANTITY preference is in stort tons.");          }          return new Mass(task.getPreferredValue(AspectType.QUANTITY),                          Mass.SHORT_TONS);        }      case (TONS):        return new Mass(task.getPreferredValue(AspectType.QUANTITY),                        Mass.SHORT_TONS);      default:        logger.error("Sizer: invalid quantity unit specified - " +                     quantityUnit +                     " - assuming TONS.");        return new Mass(task.getPreferredValue(AspectType.QUANTITY),                        Mass.SHORT_TONS);    }  }