refactor: code quality improvements#175
Open
mikaello wants to merge 8 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.