You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/08/10 15:46:41 UTC
[PR] Delete dead DSL code and correct the shared kernel's own documentation [skywalking]
wu-sheng opened a new pull request, #13973:
URL: https://github.com/apache/skywalking/pull/13973
### Delete dead DSL code and correct the shared kernel's own documentation
Follow-up to #13972. No behaviour change: deletions of unreferenced code, plus comment and
javadoc corrections. 86 insertions, 506 deletions.
#### Dead code
Each verified to have no reference in Java, resources, SPI files, codegen string literals or
FreeMarker templates — the last two matter, because a class named only from a `.ftl` looks dead to
every tool (`OALDebug` is exactly that case, and is *not* touched here).
| deleted | why |
|---|---|
| `DslContentHash` | byte-identical, zero-caller twin of the live `ContentHash`, which has 29 call sites and a test. Its javadoc told the reader to consolidate *toward* the dead copy |
| `oal-rt/.../v2/registry/` (3 classes) | a second, divergent answer to what `MetricsHolder` already does; zero references outside its own package |
| `LogAnalyzerFactory` | empty class, sole occupant of its package, one occurrence repo-wide |
| `MALCodegenHelper.RUN_VAR`, `MALExprCodegen.getVarCount()`, `DslYamlLineIndex.empty()` | no callers |
#### The kernel was asserting consumers it does not have
This is the part worth reviewing. Three classes in `server-core` carried javadoc justifying their
placement by naming users that grep disproves:
- `DSLClassLoaderManager` — *"the meter / log compile paths reach for `INSTANCE`"*. Neither
analyzer module references it. MAL and LAL accept a plain `ClassLoader` and narrow through
`BytecodeClassDefiner`, so neither ever names it.
- `LogDataDebugDump` — *"Lives in core so `LALOutputBuilder` implementations can render their
cached `LogData`"*. Zero core references; its one caller is in `log-analyzer`.
- `DslContentHash` — *"…can share one implementation"* / *"scheduled for consolidation in a
follow-up"*. The follow-up never happened and nothing shared it.
A false rationale in a shared kernel is not a stale comment, it is a standing instruction to put
more things there. Each now states what the call sites support.
The converse was also missing: `OALDebug`, `OALDebugRecorder` and `DebugHolderProvider` are
OAL-specific and by symmetry belong in `oal-rt`, where MAL's and LAL's equivalents live. They
**cannot** move — `dsl-debugging/pom.xml` declares no `oal-rt` dependency, so the recorder
implementation would lose sight of them. Nothing said so, leaving it looking like carelessness.
Now recorded on all three.
#### Residue from #13972
Fourteen sites. The worst contradicts the code beside it: `LALClassGenerator` stated *"No
LineNumberTable … an absent attribute reports an unknown line, which is honest"* eleven lines
above the call that attaches one, and above a test from the same PR asserting every method carries
one. `git show` confirms it survived as a two-word substitution inside the very hunk that added
those calls.
Also: a javadoc block orphaned when a method was inserted between it and its owner; a `{@link}` to
a method that PR deleted; `escapeJava` / `sanitizeName` / `COMPANION_SAM_LINE_IN_CLASS` named in
comments after being removed; a `log.debug("MAL YAML line index …")` in a class now serving four
DSLs; and a hierarchy javadoc example missing the line number the code actually emits.
#### Two small corrections
- `MALClassGenerator` now uses `MALCodegenHelper.GATE_HOLDER_FQCN` instead of shadowing it with an
identical local literal. The constant read as dead only because of the shadow; LAL uses its
equivalent at six sites.
- `setYamlSource` gains the `@Deprecated` its LAL and Hierarchy counterparts already carry — it was
the only one of the three giving callers no migration signal while its own delegate target was
deprecated.
#### CLAUDE.md: why generated source is fully qualified
Javassist's compiler has no `import` statement. It resolves a simple class name only against
`ClassPool.importedPackages`, initialised to `java.lang` and nothing else; widening it needs
`ClassPool.importPackage`, which is pool-wide mutable state and is never called here. So generated
source must fully qualify everything, `java.util.Map` included, and the project's
no-inline-fully-qualified-names rule applies to hand-written Java only. Shortening an FQCN inside a
codegen string or a `.ftl` compiles as Java and then fails at runtime — worth stating, since the
rule reads as universal.
- [x] Explain briefly why the bug exists and how to fix it.
- [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
- [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix LAL segmentId/spanId extractor statements; delete dead DSL code and correct the kernel's docs [skywalking]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #13973:
URL: https://github.com/apache/skywalking/pull/13973
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org