Open lzh-0330 opened 1 month ago
Thank you for reporting the issue, this looks a bit like an exception from ErrorProne itself. Are you using lombok? If so, this seems lile the same issue as https://github.com/google/error-prone/issues/1250
log_7_272.zip I add full log as attachment. I still don't know how to fix it. I use it as plugin with SQ. I need complete the analysis before changing code. Thanks
Thank you for the log but are you using lombok?
The error seems to happen when analyzing AlarmHistoryInfoServiceImpl.java
, are there references to lombok in that file?
import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; It seems, so it was aused by error-prone,right?
Lombok and errorprone both plug into the javac compiler and there were many issues when using the two together, The issue you're getting is https://github.com/google/error-prone/issues/1250 and is unresolved by errorprone or lombok.
You're getting this issue when errorprone is looking for unused variables; could it be that import lombok.extern.slf4j.Slf4j
is creating an unused logger in that class? Can you try removing import lombok.extern.slf4j.Slf4j
?
Please report this at https://github.com/google/error-prone/issues/new and include the following: [ERROR] -rf :platform
/opt/maven/bin/mvn failed with return code: 1
Could not retrieve code analysis results - Maven run failed.
[ERROR] error-prone version: 2.26.1 [ERROR] BugPattern: UnusedVariable [ERROR] Stack Trace: [ERROR] java.lang.IllegalArgumentException: Replacement{range=[3327..3351), replaceWith=} overlaps with existing replacements: Replacement{range=[3307..3551), replaceWith=} [ERROR] at com.google.common.base.Preconditions.checkArgument(Preconditions.java:445) [ERROR] at com.google.errorprone.fixes.Replacements.checkOverlaps(Replacements.java:179) [ERROR] at com.google.errorprone.fixes.Replacements.add(Replacements.java:169) [ERROR] at com.google.errorprone.fixes.SuggestedFix.getReplacements(SuggestedFix.java:95) [ERROR] at com.google.errorprone.fixes.AppliedFix$Applier.apply(AppliedFix.java:69) [ERROR] at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1220) [ERROR] at com.google.errorprone.JavacErrorDescriptionListener.lambda$new$1(JavacErrorDescriptionListener.java:94) [ERROR] at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) [ERROR] at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) [ERROR] at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853) [ERROR] at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861) [ERROR] at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) [ERROR] at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) [ERROR] at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) [ERROR] at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [ERROR] at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) [ERROR] at com.google.errorprone.JavacErrorDescriptionListener.onDescribed(JavacErrorDescriptionListener.java:107) [ERROR] at com.google.errorprone.ErrorProneAnalyzer.lambda$finished$1(ErrorProneAnalyzer.java:141) [ERROR] at com.google.errorprone.VisitorState.reportMatch(VisitorState.java:301) [ERROR] at com.google.errorprone.bugpatterns.UnusedVariable.matchCompilationUnit(UnusedVariable.java:275) [ERROR] at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:449) [ERROR] at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:555) [ERROR] at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:150) [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:614) [ERROR] at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:60) [ERROR] at com.google.errorprone.scanner.Scanner.scan(Scanner.java:58) [ERROR] at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43) [ERROR] at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:156) [ERROR] at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132) [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1397) [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1344) [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:933) [ERROR] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104) [ERROR] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152) [ERROR] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100) [ERROR] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94) [ERROR] at com.github.erroraway.sonarqube.ErrorAwaySensor.execute(ErrorAwaySensor.java:120) [ERROR] at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64) [ERROR] at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88) [ERROR] at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61) [ERROR] at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79) [ERROR] at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61) [ERROR] at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82) [ERROR] at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) [ERROR] at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) [ERROR] at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:403) [ERROR] at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:399) [ERROR] at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:396) [ERROR] at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:396) [ERROR] at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:368) [ERROR] at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) [ERROR] at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) [ERROR] at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137) [ERROR] at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) [ERROR] at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) [ERROR] at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72) [ERROR] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66) [ERROR] at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:568) [ERROR] at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) [ERROR] at jdk.proxy3/jdk.proxy3.$Proxy24.execute(Unknown Source) [ERROR] at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) [ERROR] at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) [ERROR] at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:89) [ERROR] at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:113) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:370) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:351) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:171) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:163) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:299) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:963) [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:296) [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:568) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn