Skip to content

Fix NPE from external completion providers triggered on AI query pane#303

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-nullpointerexception-send-button
Draft

Fix NPE from external completion providers triggered on AI query pane#303
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-nullpointerexception-send-button

Conversation

Copilot AI commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

When typing in the Agent mode query pane, jeddict-ai's own completion providers (AIQueryCompletionProvider, JeddictQueryCompletionProvider) registered for text/x-java would trigger the NetBeans completion framework — which then invoked all text/x-java providers, including the external MicronautDataCompletionProvider. That provider calls CompilationController.get(result) expecting a real Java source backing, gets null (the query pane has none), and throws NullPointerException.

Changes

  • AssistantChat.java: Use text/plain for the questionPane editor kit instead of text/x-java. The input pane is free-form text; it has no Java source backing and doesn't need Java-specific providers.
  • AIQueryCompletionProvider: Changed @MimeRegistration from text/x-javatext/plain to stay registered on the query pane.
  • JeddictQueryCompletionProvider: Changed @MimeRegistration from text/x-javatext/plain, and added a guard in getAutoQueryTypes() so it only triggers auto-completion on editors with JEDDICT_EDITOR_CALLBACK set — preventing it from firing on every plain-text file in the IDE.
// Before: exposes the query pane to all text/x-java completion providers
questionPane.setEditorKit(createEditorKit("text/x-" + (type == null ? "java" : type)));

// After: isolated to text/plain; no external Java providers invoked
questionPane.setEditorKit(createEditorKit(MIME_PLAIN_TEXT));

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • openrouter.ai
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -javaagent:/home/REDACTED/.m2/repository/org/jacoco/org.jacoco.agent/0.8.12/org.jacoco.agent-0.8.12-runtime.jar=destfile=/home/REDACTED/work/jeddict-ai/jeddict-ai/target/jacoco.exec --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.desktop/sun.awt=ALL-UNNAMED --add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.desktop/sun.java2d=ALL-UNNAMED --add-exports=java.desktop/sun.java2d=ALL-UNNAMED --add-exports=java.desktop/sun.awt.image=ALL-UNNAMED --add-exports=java.desktop/java.awt.peer=ALL-UNNAMED --add-exports=java.desktop/sun.awt.event=ALL-UNNAMED --add-exports=java.base/sun.security.action=ALL-UNNAMED -jar /home/REDACTED/work/jeddict-ai/jeddict-ai/target/surefire/surefirebooter-20260317154432012_378.jar /home/REDACTED/work/jeddict-ai/jeddict-ai/target/surefire 2026-03-17T15-44-31_067-jvmRun1 surefire-20260317154432012_376tmp (dns block)
  • www.netbeans.org
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/xml/tools/xml-extractor.jar --fileList=/tmp/codeql-scratch-cd61c9847ee61009/dbs/java/working/files-to-index12149872662966825360.list --sourceArchiveDir=/tmp/codeql-scratch-cd61c9847ee61009/dbs/java/src --outputDir=/tmp/codeql-scratch-cd61c9847ee61009/dbs/java/trap/java k/jeddict-ai/jeddict-ai/src/main/java/io/github/jeddict/ai/util/FileUtil.java k/_temp/ghcca-node/node/bin/grep implements nse/ToolExecutio17.0.18+8 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

… pane

Co-authored-by: jGauravGupta <15934072+jGauravGupta@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix NullPointerException on send button in Agent mode Fix NPE from external completion providers triggered on AI query pane Mar 17, 2026
Copilot AI requested a review from jGauravGupta March 17, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants