Cannot get rid of “Make “[field name]” transient or serializable.” warning from SonarLint on Intellij

SonarLint plugin on Intellij (IntelliJ IDEA 2024.1.1 (Ultimate Edition)) shows warnings like: Make "[field name]" transient or serializable. I cannot get rid of it, even though I definitely should.

Here are the details. I have ParentDTO class (SpringBoot annotations here):

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "Description")
public class ParentDTO implements Serializable {
    @NotNull
    @Schema(description = "Test", requiredMode = Schema.RequiredMode.REQUIRED)
    private String test;

    @NotNull
    @Schema(description = "Child", requiredMode = Schema.RequiredMode.REQUIRED)
    private ChildDTO child;
}

and ChildDto class:

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "Child description")
public class ChildDTO {
    @NotNull
    @Schema(description = "Name", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;
}

With that two classes I spoted Make "child" transient or serializable warning on ParentDto class. Ok, my mistake, ChildDTO class should be also Serializable, so I changed to:

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "Child description")
public class ChildDTO implements Serializable {
    @NotNull
    @Schema(description = "Name", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;
}

but suprisingly the warning has NOT gone. I tried to:

  1. Restart Intellij (with all caches cleared)
  2. Update SonarList plugin to the newest version
  3. Configure new project on Intellij on a brand new git clone

The warning is still there.

Then I did some stupid thing: I refactored ChildDTO class name to ChildDTOx class name – the warning has gone. What??? When I rolled back the warning appeared again. Next I added new class ChildDTODummy with the same structure as ChildDTO and added reference from ParentDTO:

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "Description")
public class ParentDTO implements Serializable {
    @NotNull
    @Schema(description = "Test", requiredMode = Schema.RequiredMode.REQUIRED)
    private String test;

    @NotNull
    @Schema(description = "Child", requiredMode = Schema.RequiredMode.REQUIRED)
    private ChildDTO child;

    @NotNull
    @Schema(description = "Child dummy", requiredMode = Schema.RequiredMode.REQUIRED)
    private ChildDTODummy childDummy;
}

…and there is no warning like: Make "childDummy" transient or serializable. I also removed implementation of Serializable interface from ChildDummy class and the additional warning still did not appear. What??? I think it should.

Does anybody has an idea what is going on here? Why SonarLint shows warning where it should not, and not showing where it should?

Thanks for any reply.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật