Skip to content

Fix misc javac lint warnings (auxiliaryclass, cast, try, static, ...) - #4009

Closed
wadoon wants to merge 7 commits into
weigl/cw-serialfrom
weigl/cw-misc
Closed

wadoon wants to merge 7 commits into
weigl/cw-serialfrom
weigl/cw-misc

Conversation

@wadoon

@wadoon wadoon commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What

Fix the remaining "misc" javac lint categories in 21 files: auxiliaryclass
(15), cast (4), dangling-doc-comments (5), try (4), static (3),
text-blocks (1), varargs (1). 7 commits, one per category.

Strategy

  • cast / dangling-doc-comments / try / static / text-blocks / varargs —
    all fixed directly (redundant cast removed, doc comment attached, empty
    try-with-resources narrowed, instance.Static → Class.Static,
    @SafeVarargs).
  • auxiliaryclass — 8 of 15 resolved by type-safe restructures:
    • AbstractSMTTranslator: helper param SortWrapper → predicate-name
      StringBuilder;
    • GenericTranslator: VariablePool → AssumptionGenerator (public
      implementor, sole call site), class-level suppression then removed;
    • SolverTimeout: field/ctor param Session → Object with a
      loud-failure cast at the single use site — the one non-type-safe
      change
      , documented in the workstream report; the remaining 7 keep
      class-level suppressions (javac 25 auxiliaryclass Enter-phase
      regression, JDK-8354216).

Draft — part of the warning-cleanup stack (gh stack #4010, base PR #4004,
ultimately targeting #4001). No test/logic changes.

Commits carry Co-Authored-By: OpenCode (KIT Medium).

History audit (serial/this-escape)

Audited for the campaign cleanup: this branch contains NO serial or
this-escape fixes (no serialVersionUID, transient or serial/this-escape
suppressions anywhere in its 7 commits) — nothing to remove; history
unchanged, head f1985dd.

Linear-stack head: ae411b5de3 (re-based on the rebuilt #4004).

@wadoon
wadoon added this pull request to stack #4010 October 24, 2026 22:26
@wadoon wadoon changed the title weigl/cw misc Fix misc javac lint warnings (auxiliaryclass, cast, try, static, ...) Oct 24, 2026
@wadoon
wadoon removed this pull request from stack #4010 October 24, 2026 22:40
@wadoon
wadoon added this pull request to stack #4014 October 24, 2026 23:13
javac 25's auxiliaryclass lint fires on references to non-public
top-level classes from other source files. Keep the references legal
where required, drop them where not:

- AbstractSMTTranslator: pass predicate-name StringBuilders instead of
  SortWrapper helper parameters (auxiliary class of SortHierarchy.java);
  keep class-level suppression for in-body uses.
- SolverTimeout: re-type Session field/constructor parameter to Object
  (Session is an auxiliary class of SolverLauncher.java; the single
  caller always passes a Session) and cast at the use site.
- JavaCardDLStrategy: qualify constant references and drop the static
  imports (import positions are not suppression-eligible).
- GenericTranslator: type the pool as AssumptionGenerator (the public
  interface implementor) instead of auxiliary VariablePool.
- KeyboardTacletTest: suppress with an explanatory comment.

Co-Authored-By: OpenCode (KIT Medium)
Remove casts that javac flags as redundant (no behavior change):
- CompiledMatchProgramBenchmark, CompiledMatchProgramTest
- Filenames (key.util)
- ImmutableList (key.util)

Co-Authored-By: OpenCode (KIT Medium)
javac 25 treats lines with a leading third slash as part of a doc
comment; replace such malformed delimiters with plain comments so no
text is silently dropped or attached to the preceding javadoc.

Affects MethodResolutionTest, TestNamingInvariants,
SemisequentChangeInfo, Pair and CheckerData.

Co-Authored-By: OpenCode (KIT Medium)
- DataRecordingTable: narrow close() from AutoCloseable to
  Closeable, which lets RuleIndependentData (whose only resource is
  a DataRecordingTable) drop its try-with-resources suppression too.
- TestCopyingReplayer: suppress the resource-related warning where the
  managed resource intentionally outlives the method.

Co-Authored-By: OpenCode (KIT Medium)
Make obviously-static accesses go through the declaring class
instead of an instance where the instance is merely a name for a
static method (TestPosInTerm, TestTacletBuild).

Co-Authored-By: OpenCode (KIT Medium)
javac 25's text-blocks lint fires when a content line is less
indented than the closing delimiter. Dedent the closing triple quote
to the minimum content indentation, which yields a byte-identical
string (verified at runtime).

Co-Authored-By: OpenCode (KIT Medium)
SumFeature's element type Feature is reifiable, so javac flags the
@SafeVarargs annotation as redundant. Drop it; the varargs array is
treated as final and never exposed, preserving behavior.

Co-Authored-By: OpenCode (KIT Medium)
@wadoon wadoon closed this Oct 25, 2026
@wadoon
wadoon deleted the weigl/cw-misc branch October 25, 2026 02:33
@wadoon
wadoon removed this pull request from stack #4014 October 26, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant