Commit 1ead856
committed
refactor(otel): use compatibility helpers instead of duplicating entire file
Address PR review feedback to avoid copying entire OTelService.kt for version compatibility.
Changes:
- Move OTelService.kt to common src/ directory (168 lines, shared by all versions)
- Create small version-specific HttpPostCompat.kt files (18-19 lines each)
- Eliminates 137 lines of code duplication
- Main logic now maintained in single location
The httpPost API changed between IDE versions 2024.2-2025.2 and 2025.3+:
- Old API uses contentLength parameter with streaming body
- New API uses body parameter with byte array
Follows existing codebase pattern (see PythonModuleUtil.kt, JavascriptLanguage.kt)
for handling compile-time API incompatibilities with minimal duplication.1 parent bf1a830 commit 1ead856
File tree
4 files changed
+38
-175
lines changed- plugins/core/jetbrains-community
- src-242-252/software/aws/toolkits/jetbrains/services/telemetry/otel
- src-253+/software/aws/toolkits/jetbrains/services/telemetry/otel
- src/software/aws/toolkits/jetbrains/services/telemetry/otel
4 files changed
+38
-175
lines changedLines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Lines changed: 0 additions & 171 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 53 | + | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
| |||
0 commit comments