ABAPQuickFix
ABAPQuickFix copied to clipboard
QuickFix invocation causes BadLocationException in Report - no Proposals shown (or not all)
Observation
In Reports and also in FM Quickfix proposals are not shown. In debug mode a BadLocationException can be observed in AbapStatement initialization.
Apparently endOfStatement is negative and causes substring(.) to fail.
How to reproduce
Several small test reports show this behavior. For example see this example report (minial). Place curson on data and press Ctrl-1.
report z_test.
data(temp) = 1.
@fd1899 has reported this odd behavior in ABAPQuickFixS4Conversion/#6 for other reports. The problem occurs with the ABAPQuickFixS4Conversion plugin installes as well as without the plugin.
Versions
- Eclippse: 2024-03 (4.31)
- ABAPQuickFix 1.16
Stacktrace
org.eclipse.jface.text.BadLocationException
at org.eclipse.jface.text.AbstractDocument.getChar(AbstractDocument.java:774)
at org.eclipse.core.internal.filebuffers.SynchronizableDocument.getChar(SynchronizableDocument.java:141)
at com.abapblog.adt.quickfix.assist.syntax.codeParser.AbapStatement.<init>(AbapStatement.java:25)
at com.abapblog.adt.quickfix.assist.syntax.codeParser.AbapCodeReader.createStatement(AbapCodeReader.java:46)
at com.abapblog.adt.quickfix.assist.syntax.codeParser.AbapCodeReader.<init>(AbapCodeReader.java:34)
at com.abapblog.adt.quickfix.assist.syntax.codeParser.AbapCodeReader.getInstance(AbapCodeReader.java:55)
at com.abapblog.adt.quickfix.assist.syntax.statements.StatementsAssistProcessor.computeQuickAssistProposals(StatementsAssistProcessor.java:130)
at com.sap.adt.tools.abapsource.ui.sources.QuickAssistProcessorManager.computeQuickAssistProposals(QuickAssistProcessorManager.java:58)
at org.eclipse.jface.text.quickassist.QuickAssistAssistant$ContentAssistProcessor.computeCompletionProposals(QuickAssistAssistant.java:71)
at org.eclipse.jface.text.contentassist.ContentAssistant$2.lambda$0(ContentAssistant.java:2064)
at java.base/java.util.Collections$SingletonSet.forEach(Collections.java:5125)
at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:2063)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2060)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:577)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.lambda$0(CompletionProposalPopup.java:507)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:502)
at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1874)
at org.eclipse.jface.text.quickassist.QuickAssistAssistant.showPossibleQuickAssists(QuickAssistAssistant.java:113)
at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:1005)
at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1468)
at com.sap.adt.tools.abapsource.ui.sources.editors.AdtProjectionViewer.doOperation(AdtProjectionViewer.java:243)
at com.sap.adt.refactoring.ui.internal.quickfix.AbapQuickfixProcessor$AsyncQuickfixCalculatorJob.retriggerContentAssist(AbapQuickfixProcessor.java:754)
at com.sap.adt.util.ui.contentassist.AsyncContentAssistProposalCalculatorJob.lambda$0(AsyncContentAssistProposalCalculatorJob.java:74)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4047)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3663)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
at org.eclipse.equinox.launcher.Main.main(Main.java:1432)
Range [1, 0) out of bounds for length 41