Commit 7d1692c
committed
feat:Add reflection-based handling for java.sql.Timestamp to avoid module dependency
- Introduce static reflection initialization for Timestamp class/method
- Use isTimestamp() to check instance type without direct dependency
- Extract nanoseconds via reflection in extractNanosFromSqlTimestamp()
- Gracefully handle absence of java.sql module with null checks and exception handling
- Maintain existing functionality for converting Timestamps to LocalDateTime with nanosecond precision
- Ensure compatibility with both modular (JPMS) and non-modular environments
- Remove unused Instant import in test class for cleaner imports
Signed-off-by: finger <finger.xie@foxmail.com>1 parent f7928be commit 7d1692c
File tree
2 files changed
+52
-4
lines changed- src
- main/java/org/apache/commons/lang3/time
- test/java/org/apache/commons/lang3/time
2 files changed
+52
-4
lines changedLines changed: 52 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
208 | 231 | | |
209 | 232 | | |
210 | 233 | | |
| |||
1651 | 1674 | | |
1652 | 1675 | | |
1653 | 1676 | | |
1654 | | - | |
1655 | | - | |
| 1677 | + | |
| 1678 | + | |
1656 | 1679 | | |
1657 | 1680 | | |
1658 | 1681 | | |
1659 | 1682 | | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
1660 | 1709 | | |
1661 | 1710 | | |
1662 | 1711 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
0 commit comments