2

I have created a class as follows:

package classes;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
public class Book {
    
    private String title;
    private String number;
    
    public Book(String title, String number) {
        this.title = title;
        this.number = number;
    }
   
}

When I analyse this code with SonarQube I get the following code smell:

Image

Why does SonarQube consider this field as unused?

Community
  • 1
  • 1
ziMtyth
  • 1,008
  • 16
  • 32

0 Answers0