Remove unused private methods and commented-out code

CH
11h ago
+0-140

Summary

Removes private methods that nothing calls, plus the constants and commented-out code that only existed for them. Generated output is unchanged.

  • InlineModelResolver: fixStringModel with its helpers schemaIsOfType and schemaContainsExample, and makeSchema (replaced by makeSchemaInComponents in #12353; only a commented-out call was left)
  • AbstractApexCodegen: sanitizePackageName, sanitizePath, the commented-out getAccept block and the Guava Strings import
  • AbstractAdaCodegen: isMimetypeOctetStream and APPLICATION_OCTET_STREAM
  • RustServerCodegen, RustServerCodegenDeprecated: isMimetypeOctetStream (and octetMimeType in RustServerCodegen)
  • KotlinServerCodegen: isKtor2 (only isKtor2Or3 is used)
  • CppOatppClientCodegen, CppOatppServerCodegen: postProcessSingleParam

Most were never called since they were added (copied from another generator or migrated from swagger-codegen); the InlineModelResolver and Rust ones lost their last caller in earlier refactors.

CC committee members

cc technical committee members for the touched generators (Apex has none listed):

  • Ada: @stcarrez @michelealbano
  • C++: @ravinikam @stkrwork @etherealjoy @martindelille @muttleyxd @aminya
  • Kotlin: @karismann @Zomzog @andrewemery @4brunu @yutaka0m @stefankoppier @e5l
  • Rust: @frol @farcaller @richardwhiuk @paladinzh @jacob-pro @dsteeley

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Removes private methods, constants, and commented-out code that nothing calls so the dead code no longer looks like it should be used. Generated output is unchanged; most removed methods were never called since they were added, and the InlineModelResolver and Rust ones lost their last caller in earlier refactors.

  • InlineModelResolver: removes fixStringModel and its helpers, makeSchema, and a commented-out call.
  • Apex, Ada, C++ Oat++, Kotlin, Rust, and JavaScript generators: removes unused mimetype checks, sanitizers, the Guava import, isKtor2, postProcessSingleParam, and commented-out sanitizePath blocks.