microsoft / microsoft/vscode-java-test

Cannot invoke "org.eclipse.jdt.core.dom.ASTNode.getParent()"

Open
#1,400 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged bug high-priority test-discovery
Dominant language
TypeScript
Stars
340
Forks
173
Avg merge
1d 19h
Merged PRs (30d)
18

Description

java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.dom.ASTNode.getParent()" because "node" is null
	at org.eclipse.jdt.internal.corext.dom.ASTNodes.getParent(ASTNodes.java:2491)
	at org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil.getTypeDeclarationNode(ASTNodeSearchUtil.java:182)
	at com.microsoft.java.test.plugin.util.TestSearchUtils.findTestTypesAndMethods(TestSearchUtils.java:349)
	at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:60)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:215)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at TestSearchUtils.findTestTypesAndMethods, following its call from TestDelegateCommandHandler.executeCommand and the ASTNodeSearchUtil.getTypeDeclarationNode stack frame. Reproduce the command that produces this trace and determine why the node is null; done means the reported command no longer throws this NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.