p3c IDEA PLUGIN Index out of bounds Exception.

m2xkgtsf  于 2022-10-25  发布在  其他
关注(0)|答案(2)|浏览(241)

Describe the bug

IDEA 的插件在执行编码规约扫描之后出现 Index out of bounds Exception.

To Reproduce

Steps to reproduce the behavior:
偶尔复现。

Expected behavior

不出现数组越界。

Screenshots

Desktop (please complete the following information):

  • OS: MacOS 12.4 Apple M1
  • IDEA:

  • Alibaba Java Coding Guidelines Plugin

Additional context

In file: 我的项目的一个Mapper文件,XXXXMapper.java

java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at com.siyeh.ig.inheritance.MissingOverrideAnnotationInspection.buildFix(MissingOverrideAnnotationInspection.java:61)
at com.alibaba.p3c.idea.inspection.standalone.AliMissingOverrideAnnotationInspection.buildFix(AliMissingOverrideAnnotationInspection.kt:68)
at com.siyeh.ig.BaseInspectionVisitor.createFixes(BaseInspectionVisitor.java:218)
at com.siyeh.ig.BaseInspectionVisitor.createAndInitFixes(BaseInspectionVisitor.java:203)
at com.siyeh.ig.BaseInspectionVisitor.registerError(BaseInspectionVisitor.java:167)
at com.siyeh.ig.BaseInspectionVisitor.registerError(BaseInspectionVisitor.java:160)
at com.siyeh.ig.BaseInspectionVisitor.registerMethodError(BaseInspectionVisitor.java:111)
at com.alibaba.p3c.idea.inspection.standalone.AliMissingOverrideAnnotationInspection$MissingOverrideAnnotationVisitor.visitMethod(AliMissingOverrideAnnotationInspection.kt:106)
at com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:289)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:81)
at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:56)
at com.intellij.codeInspection.InspectionEngine.lambda$inspectElements$9(InspectionEngine.java:282)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1152)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:86)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.helpCC(ForkJoinPool.java:1115)
at java.base/java.util.concurrent.ForkJoinPool.awaitJoin(ForkJoinPool.java:1687)
at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1039)
at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:73)
at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:49)
at com.intellij.codeInspection.InspectionEngine.lambda$inspectElements$10(InspectionEngine.java:301)
at com.intellij.codeInspection.InspectionEngine.withSession(InspectionEngine.java:226)
at com.intellij.codeInspection.InspectionEngine.inspectElements(InspectionEngine.java:242)
at com.intellij.codeInspection.InspectionEngine.inspectElements(InspectionEngine.java:215)
at com.intellij.codeInspection.InspectionEngine.inspectEx(InspectionEngine.java:121)
at com.intellij.codeInspection.ex.GlobalInspectionContextImpl.lambda$inspectFile$19(GlobalInspectionContextImpl.java:480)
at com.intellij.codeInspection.ex.InspectionProfileWrapper.runWithCustomInspectionWrapper(InspectionProfileWrapper.java:89)
at com.intellij.codeInspection.ex.GlobalInspectionContextImpl.inspectFile(GlobalInspectionContextImpl.java:477)
at com.intellij.codeInspection.ex.GlobalInspectionContextImpl.lambda$runTools$6(GlobalInspectionContextImpl.java:347)
at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:113)
at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$1(DumbService.java:157)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:933)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:68)
at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:150)
at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:113)
at com.intellij.openapi.project.DumbService.tryRunReadActionInSmartMode(DumbService.java:130)
at com.intellij.codeInspection.ex.GlobalInspectionContextImpl.lambda$runTools$12(GlobalInspectionContextImpl.java:332)
at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.lambda$call$0(JobLauncherImpl.java:297)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:282)
at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:270)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

0vvn1miw

0vvn1miw1#

只要检测到缺失Override注解就会显示数组越界,可以试一下这个#900 (comment)

ibps3vxo

ibps3vxo2#

只要检测到缺失Override注解就会显示数组越界,可以试一下这个#900 (comment)

好的,谢谢。

相关问题