Skip to content

fix: NPE when file is stored in semantic cache location where rawLocation returns null#528

Merged
Will-ShaoHua merged 3 commits intoaws:mainfrom
Will-ShaoHua:inline-auto
Jan 20, 2026
Merged

fix: NPE when file is stored in semantic cache location where rawLocation returns null#528
Will-ShaoHua merged 3 commits intoaws:mainfrom
Will-ShaoHua:inline-auto

Conversation

@Will-ShaoHua
Copy link
Contributor

@Will-ShaoHua Will-ShaoHua commented Jan 20, 2026

Issue #, if available:

After

eclipse-auto-trigger-bug-fix.mov

Description of changes:

ENTRY amazon-q-eclipse 4 0 2026-01-08 08:49:37.656
!MESSAGE Error processing inline completion request 68de3c55-64e5-4a70-aad1-68ed3fe1968d
!STACK 0
java.util.concurrent.ExecutionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request aws/textDocument/inlineCompletionWithReferences failed with message: Cannot read properties of undefined (reading 'uri')
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
	at software.aws.toolkits.eclipse.amazonq.util.QInvocationSession.processRequest(QInvocationSession.java:220)
	at software.aws.toolkits.eclipse.amazonq.util.QInvocationSession.lambda$1(QInvocationSession.java:192)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
Caused by: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request aws/textDocument/inlineCompletionWithReferences failed with message: Cannot read properties of undefined (reading 'uri')
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:204)
	at software.aws.toolkits.eclipse.amazonq.lsp.AmazonQLspServerBuilder.lambda$2(AmazonQLspServerBuilder.java:105)
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$3(LanguageServerWrapper.java:449)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

!ENTRY amazon-q-eclipse 4 0 2026-01-08 08:49:40.237
!MESSAGE Unexpected error when determining open file path
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.core.runtime.IPath.toOSString()" because the return value of "org.eclipse.core.resources.IFile.getRawLocation()" is null
	at software.aws.toolkits.eclipse.amazonq.util.QEclipseEditorUtils.getOpenFilePath(QEclipseEditorUtils.java:149)
	at software.aws.toolkits.eclipse.amazonq.util.QEclipseEditorUtils.getOpenFileUri(QEclipseEditorUtils.java:121)
	at software.aws.toolkits.eclipse.amazonq.util.InlineCompletionUtils.cwParamsFromContext(InlineCompletionUtils.java:26)
	at software.aws.toolkits.eclipse.amazonq.util.QInvocationSession.invoke(QInvocationSession.java:162)
	at software.aws.toolkits.eclipse.amazonq.util.AutoTriggerDocumentListener.documentChanged(AutoTriggerDocumentListener.java:53)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:762)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:730)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:714)
	at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:790)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1132)
	at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:271)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1150)
	at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:259)
	at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:225)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7188)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8088)
	at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2069)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5771)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5802)
	at org.eclipse.swt.custom.StyledText.lambda$32(StyledText.java:5481)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4364)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1217)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1241)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1226)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1268)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1264)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1747)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4982)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:341)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4859)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:336)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5132)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3748)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1147)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1038)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:677)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:583)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:185)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
	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:615)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Will-ShaoHua Will-ShaoHua merged commit fdc3e7a into aws:main Jan 20, 2026
1 check passed
@Will-ShaoHua Will-ShaoHua deleted the inline-auto branch January 20, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants