Search code examples
javajava-8sonarqube

SonarQube throws CodeSmell "Add the missing @deprecated Javadoc tag."


I use Java 8 and the existing code just had @Deprecated and it was tagged by SonarQube. I tried adding @deprecated Javadoc tag to fix this issue. But, it still throws the same error. Here's what I have added:

@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
/**
 * @deprecated (Not using this now)
 */
@Deprecated
public class SomeClass {

Can someone please point out what the mistake is in the above code? Or, provide me the correct way to solve this issue.


Solution

  • Try this:

    /**
     * @deprecated (when, why, refactoring advice...)
     */
    @Deprecated
    @Data
    @AllArgsConstructor
    @Builder
    @NoArgsConstructor
    public class SomeClass {
    
    }
    

    For more information: https://rules.sonarsource.com/java/RSPEC-1123