SonarJava-71 使用 javax.annotation.Generated 注释时排除生成代码的问题

SonarJava-71 Exclude issues on generated code when annotated with javax.annotation.Generated(SonarJava-71 使用 javax.annotation.Generated 注释时排除生成代码的问题)

本文介绍了SonarJava-71 使用 javax.annotation.Generated 注释时排除生成代码的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了这个https://jira.sonarsource.com/browse/SONARJAVA-71 改进当前状态为关闭.我被要求在这里提出我的问题.

I see this https://jira.sonarsource.com/browse/SONARJAVA-71 improvement which the current status is closed. I was asked to raise my question here.

我想知道如何实施修复,因为我尝试使用最新的 SonarJava 4.10.0.10260,但是它仍然报告带有 @generated 注释的类/方法问题.请告知如何实施此修复程序.包含此修复程序的 SonarJava 版本.谢谢!

I would like to know how to implement the fix because i tried to use latest SonarJava 4.10.0.10260, however it still reports issues on class/methods with @generated annotation. Please advise how to implement this fix. Which version of SonarJava release this fix is included. Thanks!

推荐答案

SONARAVA-71 已在 SonarJava Analyzer 版本 4.9 中实现,因此如果配置正确,您的 SonarJava 版本应忽略此类带注释的元素.

SONARAVA-71 has been implemented in version 4.9 of the SonarJava Analyzer, so your version of SonarJava should ignore such annotated elements if configured correctly.

现在,为了让使用(并且仅使用)@javax.annotation.Generated 注释的类和方法被分析器忽略,请确保 为您的分析提供字节码.

Now, in order to have classes ans methods annotated with (and only with) @javax.annotation.Generated being ignored by the analyzer, be sure to provide the bytecode for your analysis.

这篇关于SonarJava-71 使用 javax.annotation.Generated 注释时排除生成代码的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:SonarJava-71 使用 javax.annotation.Generated 注释时排除生成代码的问题

基础教程推荐