Skip to content

Actuator Info class has inconsistent nullability annotations and cannot be built with null value#48480

Closed
ngocnhan-tran1996 wants to merge 1 commit intospring-projects:mainfrom
ngocnhan-tran1996:add-nullable
Closed

Actuator Info class has inconsistent nullability annotations and cannot be built with null value#48480
ngocnhan-tran1996 wants to merge 1 commit intospring-projects:mainfrom
ngocnhan-tran1996:add-nullable

Conversation

@ngocnhan-tran1996
Copy link
Copy Markdown
Contributor

From gh-48401, I wrote a test

    @Test
    fun contextLoads() {
        val map = mutableMapOf<String, Any?>("info" to null)
        assertDoesNotThrow { Info.Builder().withDetails(map).build() }
    }

and it failed

> Task :compileTestKotlin FAILED
Argument type mismatch: actual type is 'HashMap<String, Any?>', but '(Mutable)Map<String, out Any>' was expected.
Java type mismatch: expected '(Mutable)Map<String, out Any>' but found 'HashMap<String, Any?>'. Use explicit cast.

This PR fixes the above issue.

Signed-off-by: Tran Ngoc Nhan <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 9, 2025
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 9, 2025
@philwebb philwebb added this to the 4.0.x milestone Dec 9, 2025
@philwebb philwebb changed the title Add @Nullable for the Info class Actuator Info class has inconsistent nullability annotations and cannot be built with null value Dec 9, 2025
philwebb pushed a commit that referenced this pull request Dec 9, 2025
@philwebb philwebb closed this in 7347d7e Dec 9, 2025
@philwebb philwebb modified the milestones: 4.0.x, 4.0.1 Dec 9, 2025
@philwebb
Copy link
Copy Markdown
Member

philwebb commented Dec 9, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants