Fix Java and Kotlin compilation warnings - #12
Closed
lanarimarco with Copilot wants to merge 4 commits into
Closed
Conversation
Co-authored-by: lanarimarco <40103274+lanarimarco@users.noreply.github.com>
Co-authored-by: lanarimarco <40103274+lanarimarco@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix java and kotlin compilation warning
Fix Java and Kotlin compilation warnings
Sep 4, 2025
Owner
|
@copilot |
Co-authored-by: lanarimarco <40103274+lanarimarco@users.noreply.github.com>
Author
I've rerun clean testClasses and ktlintCheck and addressed the remaining Kotlin compilation warnings. The two unchecked cast warnings in errors.kt and misc.kt have been resolved by adding @Suppress("UNCHECKED_CAST") annotations, following the existing pattern used in the codebase. Both commands now pass successfully without any warnings related to the changes made in this PR. (commit a4aecf0) |
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.
This PR resolves all Java and Kotlin compilation warnings that were appearing when running
./gradlew testClasses. The warnings were primarily related to deprecated API usage and unchecked type casts across multiple modules.Changes Made
Deprecated API Replacements
kolasu module:
tryToResolve(List<N>)method with the recommendedtryToResolve(Map<String, N>)overload inModelTest.ktrpgJavaInterpreter-core main sources:
Date(int, int, int)constructor withCalendarAPI indata_definitions.ktLoggerConfig.createLogger()method to use the builder pattern withLoggerConfig.newBuilder()inlogging.ktBOMInputStream(InputStream)constructor withBOMInputStream.builder()pattern inmute.ktrpgJavaInterpreter-core test sources:
Char.toByte()usage by replacing withChar.code.toByte()inJDExamplesTest.ktReaderInputStream(Reader, Charset)constructor to use builder pattern inRunnerCliTest.ktcreateTempDir()function withkotlin.io.path.createTempDirectory().toFile()inMuteRunnerTest.ktBOMInputStreamconstructors to use builder pattern inRpgParserWithMuteSupportTest.ktUnchecked Cast Warning Suppressions
@Suppress("UNCHECKED_CAST")annotations to suppress legitimate unchecked cast warnings inerrors.ktandmisc.kt, following the existing codebase patternCode Formatting
Fixed ktlint formatting issues that were introduced during the deprecation fixes, including:
Verification
./gradlew clean testClassesnow passes without any Java/Kotlin compilation warnings./gradlew ktlintCheckpasses with no formatting errorsThe codebase now compiles cleanly without deprecation warnings while maintaining full backward compatibility and test coverage.
Fixes #11.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.