英文:
SonarQube throws CodeSmell "Add the missing @deprecated Javadoc tag."
问题
我使用Java 8,现有的代码只有@Deprecated标记,并且已被SonarQube标记。我尝试添加@deprecated Javadoc标记来解决这个问题。但是,它仍然抛出相同的错误。这是我添加的内容:
@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
/**
* @deprecated (现在不使用此)
*/
@Deprecated
public class SomeClass {
有人可以指出上面的代码中的错误是什么吗?或者,提供正确解决此问题的方法。
英文:
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.
答案1
得分: 1
尝试这个:
/**
* @deprecated(何时、为什么、重构建议...)
*/
@Deprecated
@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class SomeClass {
}
更多信息请参阅: https://rules.sonarsource.com/java/RSPEC-1123
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论