Skip to content

refactor: code quality improvements#175

Open
mikaello wants to merge 8 commits into
mainfrom
code-quality-improvements
Open

refactor: code quality improvements#175
mikaello wants to merge 8 commits into
mainfrom
code-quality-improvements

Conversation

@mikaello
Copy link
Copy Markdown
Contributor

@mikaello mikaello commented Apr 5, 2026

No description provided.

mikaello added 8 commits April 4, 2026 18:17
classesV3 and classesV2 are lists of Class<*> objects. Calling .javaClass
on a Class<*> returns the metaclass (java.lang.Class), so nameFromJavaClass
was receiving java.lang.Class for every entry and producing ["class", "class", ...]
instead of the actual type names. Pass the Class<*> directly instead.
…rinting to stdout

Callers of unmarshalV3Xml and unmarshalV2Xml with a mismatched className would
silently continue and produce an incorrectly typed result. Throwing
IllegalArgumentException makes the programming error visible immediately
and prevents the call from producing a cast exception later.
…sonMapper builder API

ObjectMapper.setSerializationInclusion was deprecated in Jackson 2.13.
Using JsonMapper.builder().serializationInclusion() is the recommended
replacement and eliminates the compiler deprecation warning.
java.lang is automatically available on the JVM platform and does not
need to be explicitly imported in Kotlin source files.
Kotlin does not require statement-terminating semicolons. The two occurrences
in V2Unmarshallers.kt were leftovers from Java-style code.
Two commented-out mapper configuration lines were left in iofJsonToXml and
marshalIofObjectToJson. These are not conditional experiments but abandoned
fragments that add noise without value.
…oint

A private top-level fun main() compiles to a private static method on the
JVM. The JVM entry point requires a public static void main(String[])
signature, so ./gradlew run would fail silently. Removing the private
modifier allows the application plugin to invoke it correctly.
isNotEmpty() is the idiomatic Kotlin way to check that a string is not
empty and communicates intent more clearly than comparing length to zero.
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