Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in AST: Cannot read the array length because "this.arguments" is null #2828

Closed
travkin79 opened this issue Aug 16, 2024 · 3 comments · Fixed by #2830
Closed

NPE in AST: Cannot read the array length because "this.arguments" is null #2828

travkin79 opened this issue Aug 16, 2024 · 3 comments · Fixed by #2830
Labels
bug Something isn't working regression Something was broken by a previous change
Milestone

Comments

@travkin79
Copy link

After installing the Eclipse Platform UI using the the Oomph installer using the link given here, I get a NullPointerException that occurs in the Error Log View.

Stacktrace:

java.lang.RuntimeException: Internal Error compiling /org.eclipse.ui.genericeditor.tests/src/org/eclipse/ui/genericeditor/tests/FoldingTest.java
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.compile(ProcessTaskManager.java:167)
	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:1570)
Caused by: java.lang.NullPointerException: Cannot read the array length because "this.arguments" is null
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.isMissingTypeRelevant(MessageSend.java:1122)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:998)
	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1126)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:725)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:713)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:409)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:611)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1514)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:924)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.compile(ProcessTaskManager.java:163)
	... 5 more

Steps to reproduce

See this comment

@jukzi
Copy link
Contributor

jukzi commented Aug 16, 2024

@stephan-herrmann that code was recently added by you f6fe3c8fee3d83b2478db25eb34781b62cab668b

@jukzi jukzi added bug Something isn't working regression Something was broken by a previous change labels Aug 16, 2024
@cdietrich
Copy link

cdietrich commented Aug 16, 2024

same but different statement here

java.lang.RuntimeException: Internal Error compiling /org.eclipse.xtext.common.types.ui/src/org/eclipse/xtext/common/types/xtext/ui/JdtTypesProposalProvider.java
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.compile(ProcessTaskManager.java:167)
	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)
Caused by: java.lang.NullPointerException: Cannot read the array length because "this.arguments" is null
	at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.isMissingTypeRelevant(AllocationExpression.java:544)
	at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:508)
	at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.resolve(ReturnStatement.java:362)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:725)
	at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:128)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:311)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:725)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:713)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:409)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:611)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1514)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:924)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.compile(ProcessTaskManager.java:163)
	... 5 more

@stephan-herrmann
Copy link
Contributor

Thanks for reporting and sorry for the (unnecessary) hassle.

Luckily (!!) the stack trace points to the exact problem even without a code example.

stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue Aug 17, 2024
@stephan-herrmann stephan-herrmann added this to the 4.33 RC1 milestone Aug 19, 2024
robstryker pushed a commit to robstryker/eclipse.jdt.core that referenced this issue Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Something was broken by a previous change
Projects
None yet
4 participants