}
}
double percent = 1.0D;
Resource resource = (Resource)(parameters.isLeftAssociation() ? found : parameters.getThisObject());
Rate rate = null;
if (matcher.group(2) != null) { // if text was empty use default
if (!getParameters().isAllowDetailsEntry())
throw new ParseException(Messages.getString("Message.cannotEnterUnits"),0);
RateFormat format = resource.getRateFormat();
rate = (Rate) format.parseObject(matcher.group(2));
percent = rate.getValue();
// Number percentNumber;
// if (resource.isLabor())
// percentNumber = percentFormat.parse(matcher.group(2)+ Settings.PERCENT); // force a percent sign at the end for labor. If there are two, it is ignored
// else //TODO allow parsing values like 3/d for material resources
// percentNumber = NumberFormat.getInstance().parse(matcher.group(2));
//
// if (percentNumber == null)
// throw new ParseException(getErrorMessage(string), pos.getIndex());
// percent = percentNumber.doubleValue();
} else if (resource.isMaterial()) {
rate = new Rate(1,TimeUnit.NON_TEMPORAL);
}
Assignment ass = Assignment.getInstance((Task) (parameters.isLeftAssociation() ? parameters.getThisObject() : found),
resource,
percent,
0);