(
Map<String, String> textForms,
TextWidth tw,
OutputContext oc,
String code
)
| 510 | } |
| 511 | |
| 512 | private static String createKey( |
| 513 | Map<String, String> textForms, |
| 514 | TextWidth tw, |
| 515 | OutputContext oc, |
| 516 | String code |
| 517 | ) { |
| 518 | |
| 519 | if (tw == TextWidth.SHORT) { |
| 520 | tw = TextWidth.ABBREVIATED; |
| 521 | } |
| 522 | |
| 523 | String key = toPrefix(tw, oc) + code; |
| 524 | |
| 525 | if (!textForms.containsKey(key)) { |
| 526 | if (oc == OutputContext.STANDALONE) { |
| 527 | if (tw == TextWidth.ABBREVIATED) { |
| 528 | key = createKey(textForms, tw, OutputContext.FORMAT, code); |
| 529 | } else { |
| 530 | key = createKey(textForms, TextWidth.ABBREVIATED, oc, code); |
| 531 | } |
| 532 | } else { |
| 533 | if (tw != TextWidth.ABBREVIATED) { |
| 534 | key = createKey(textForms, TextWidth.ABBREVIATED, oc, code); |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | return key; |
| 540 | |
| 541 | } |
| 542 | |
| 543 | private static String toPrefix( |
| 544 | TextWidth tw, |
no test coverage detected