(BonusObj bo)
| 1136 | } |
| 1137 | |
| 1138 | public List<BonusPair> getStringListFromBonus(BonusObj bo) |
| 1139 | { |
| 1140 | Object creatorObj = getSourceObject(bo); |
| 1141 | |
| 1142 | List<String> associatedList; |
| 1143 | CDOMObject anObj; |
| 1144 | if (creatorObj instanceof CDOMObject) |
| 1145 | { |
| 1146 | anObj = (CDOMObject) creatorObj; |
| 1147 | associatedList = pc.getConsolidatedAssociationList(anObj); |
| 1148 | if (associatedList == null || associatedList.isEmpty()) |
| 1149 | { |
| 1150 | associatedList = NO_ASSOC_LIST; |
| 1151 | } |
| 1152 | } |
| 1153 | else |
| 1154 | { |
| 1155 | associatedList = NO_ASSOC_LIST; |
| 1156 | } |
| 1157 | |
| 1158 | List<BonusPair> bonusList = new ArrayList<>(); |
| 1159 | |
| 1160 | // Must use getBonusName because it contains the unaltered bonusType |
| 1161 | String bonusName = bo.getBonusName(); |
| 1162 | String[] bonusInfoArray = bo.getBonusInfo().split(","); |
| 1163 | String bonusType = bo.getTypeString(); |
| 1164 | |
| 1165 | for (String assoc : associatedList) |
| 1166 | { |
| 1167 | String replacedName; |
| 1168 | if (bonusName.contains(VALUE_TOKEN_REPLACEMENT)) |
| 1169 | { |
| 1170 | replacedName = bonusName.replaceAll(VALUE_TOKEN_PATTERN, assoc); |
| 1171 | } |
| 1172 | else |
| 1173 | { |
| 1174 | replacedName = bonusName; |
| 1175 | } |
| 1176 | List<String> replacedInfoList = new ArrayList<>(4); |
| 1177 | for (String bonusInfo : bonusInfoArray) |
| 1178 | { |
| 1179 | if (bonusInfo.contains(VALUE_TOKEN_REPLACEMENT)) |
| 1180 | { |
| 1181 | replacedInfoList.add(bonusInfo.replaceAll(VALUE_TOKEN_PATTERN, assoc)); |
| 1182 | } |
| 1183 | else if (bonusInfo.contains(VAR_TOKEN_REPLACEMENT)) |
| 1184 | { |
| 1185 | replacedInfoList.add(bonusName.replaceAll(VAR_TOKEN_PATTERN, assoc)); |
| 1186 | } |
| 1187 | else if (bonusInfo.equals(LIST_TOKEN_REPLACEMENT)) |
| 1188 | { |
| 1189 | replacedInfoList.add(assoc); |
| 1190 | } |
| 1191 | else |
| 1192 | { |
| 1193 | replacedInfoList.add(bonusInfo); |
| 1194 | } |
| 1195 | } |
no test coverage detected