Commit c5bf627
authored
Fix logging IP version 6 addresses with scope in RediscoveryImpl (#1435)
The `Inet6Address.getHostAddress()` returns a string with `%scope-id` at the end if it is scoped. For instance, `fe80:0:0:0:ce66:1564:db8q:94b6%6`.
The `RediscoveryImpl` error handling logic used to construct a log message with such address that it logged using the `Logger.warn(String, Object...)` method. Example: `log.warn(message)`.
Some implementations of the `Logger` interface supply the values given directly to the `String.format(String, Object...)` method. Given that the first argument is considered to be a format string, an `IllegalFormatException` may be thrown. That used to happen when the log message contained the scoped IP version 6 `getHostAddress()` value since the log message was treated as the format string.
This update fixes this issue by supplying the format string and the address values individually and letting the logger implementations to do the formatting as the log message should not be seen as the format string value.1 parent 2660b23 commit c5bf627
File tree
2 files changed
+36
-6
lines changed- driver/src
- main/java/org/neo4j/driver/internal/cluster
- test/java/org/neo4j/driver/internal/cluster
2 files changed
+36
-6
lines changedLines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
| 319 | + | |
| 320 | + | |
322 | 321 | | |
323 | | - | |
324 | | - | |
325 | | - | |
| 322 | + | |
| 323 | + | |
326 | 324 | | |
327 | 325 | | |
328 | 326 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
525 | 528 | | |
526 | 529 | | |
527 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
528 | 560 | | |
529 | 561 | | |
530 | 562 | | |
| |||
0 commit comments