From: Hirzel P. <ph...@us...> - 2008-07-17 21:04:08
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25033/src/org/tcotool/tools Modified Files: Calculator.java Log Message: better key-id Index: Calculator.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/Calculator.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Calculator.java 15 Jun 2008 18:39:14 -0000 1.9 --- Calculator.java 17 Jul 2008 21:04:13 -0000 1.10 *************** *** 28,31 **** --- 28,32 ---- import ch.softenvironment.util.AmountFormat; import ch.softenvironment.util.DeveloperException; + import ch.softenvironment.util.StringUtils; import ch.softenvironment.util.Tracer; import ch.softenvironment.util.UserException; *************** *** 326,330 **** throw new IllegalArgumentException("no key exists for code==null"); } else if (code instanceof DbObject) { ! return kind + ((DbObject)code).getId().toString(); } else { // <undefined> code --- 327,331 ---- throw new IllegalArgumentException("no key exists for code==null"); } else if (code instanceof DbObject) { ! return kind + StringUtils.getPureClassName(code.getClass()) + ((DbObject)code).getId().toString(); } else { // <undefined> code *************** *** 484,488 **** * @param amount costs to charge for given year */ ! protected void accumulateCodes(Service service, CostDriver driver, Cost cost, int year, double amount) { String kind = (cost instanceof PersonalCost ? KIND_PC : KIND_FC); Map serviceMap = getServiceMap(service); --- 485,489 ---- * @param amount costs to charge for given year */ ! protected final void accumulateCodes(Service service, CostDriver driver, Cost cost, int year, double amount) { String kind = (cost instanceof PersonalCost ? KIND_PC : KIND_FC); Map serviceMap = getServiceMap(service); *************** *** 532,537 **** key = COST_CAUSE_UNDEFINED; if (cost.getCause() != null) { ! key = cost.getCause(); } storeIntoCodeList(serviceMap, kind, key, year, amount); // pseudo-code "ESTIMATED/KNOWN" --- 533,539 ---- key = COST_CAUSE_UNDEFINED; if (cost.getCause() != null) { ! key = cost.getCause(); } + storeIntoCodeList(serviceMap, kind, key, year, amount); // pseudo-code "ESTIMATED/KNOWN" *************** *** 605,609 **** * @param amount */ ! protected void storeIntoCodeList(Map serviceMap, final String kind, Object code, int year, double amount) { if (year < INDEX_TOTAL) { Tracer.getInstance().runtimeWarning("some Cost#baseOffset must be unexpectedly negative!"); --- 607,611 ---- * @param amount */ ! protected final void storeIntoCodeList(Map serviceMap, final String kind, Object code, int year, double amount) { if (year < INDEX_TOTAL) { Tracer.getInstance().runtimeWarning("some Cost#baseOffset must be unexpectedly negative!"); |