gpt4 book ai didi

java - SonarQube JavaSquid 传感器错误,带有下划线编号

转载 作者:行者123 更新时间:2023-11-30 03:19:39 25 4
gpt4 key购买 nike

我们正在分析一个 java 项目,该项目使用 JAVA 7 下划线编号,但我们收到了下一个错误。我们假设它必须与 JavaSquid 传感器一起使用。是否有解决方法或任何更新可以解决此问题?

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: org.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : '/opt/ATLASSIAN/bamboo-home/xml-data/build-dir/78217217/ER-EADC-JOB1/erpsaas/src/test/java/co/com/psl/erpsaas/general/importacion/comprobantesContables/ComprobanteContableExcelTest.java'
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:102)
at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:75)
at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:131)
at org.sonar.java.JavaSquid.scan(JavaSquid.java:124)
at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:86)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:122)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:222)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:223)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:52)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:128)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:171)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
Caused by: java.lang.NumberFormatException: For input string: "100_000"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.valueOf(Integer.java:582)
at org.sonar.java.model.LiteralUtils.intLiteralValue(LiteralUtils.java:57)
at org.sonar.java.model.LiteralUtils.intLiteralValue(LiteralUtils.java:41)
at org.sonar.java.checks.ForLoopFalseConditionCheck.eval(ForLoopFalseConditionCheck.java:106)
at org.sonar.java.checks.ForLoopFalseConditionCheck.isConditionFalseAtInitialization(ForLoopFalseConditionCheck.java:84)
at org.sonar.java.checks.ForLoopFalseConditionCheck.visitForStatement(ForLoopFalseConditionCheck.java:52)
at org.sonar.java.checks.AbstractForLoopRule.visitNode(AbstractForLoopRule.java:53)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:89)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:115)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:91)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:115)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:91)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:115)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:91)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:115)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:91)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:115)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:91)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:115)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:91)
at org.sonar.java.ast.visitors.SubscriptionVisitor.scanTree(SubscriptionVisitor.java:72)
at org.sonar.java.ast.visitors.SubscriptionVisitor.scanFile(SubscriptionVisitor.java:65)
at org.sonar.java.checks.SubscriptionBaseVisitor.scanFile(SubscriptionBaseVisitor.java:33)
at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:123)
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:94)
... 38 more

最佳答案

这似乎是 org.sonar.java.model.LiteralUtils 类的缺陷。查看代码,有针对长数据类型的修复,但没有针对整数的修复。根据 Oracle 文档,下划线可用于大多数数字类型,但 Sonarqube 似乎只考虑长整型。

谢谢!毛里西奥·L.

关于java - SonarQube JavaSquid 传感器错误,带有下划线编号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31652784/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com