SonarJava-71 Exclude issues on generated code when annotated with 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 注释时排除生成代码的问题
基础教程推荐
- 修改 void 函数的输入参数,然后读取 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
