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

Add a test case for #2402 #2584

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add a test case for #2402 #2584

wants to merge 1 commit into from

Conversation

r0texx
Copy link

@r0texx r0texx commented Jun 17, 2024

What it does

Adding a test case for #2402

Author checklist

@jukzi
Copy link
Contributor

jukzi commented Jun 18, 2024

thanks for contributing. the build logs:

01:15:12  [ERROR] ClassInstanceCreation cannot be resolved to a type
01:15:12  [ERROR] /home/jenkins/agent/workspace/eclipse.jdt.core-Github_PR-2584/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java:[1994] 
01:15:12  [ERROR] 	ClassInstanceCreation expr = (ClassInstanceCreation) stmt.getExpression();
01:15:12  [ERROR] 	                              ^^^^^^^^^^^^^^^^^^^^^
01:15:12  [ERROR] ClassInstanceCreation cannot be resolved to a type
01:15:12  [ERROR] /home/jenkins/agent/workspace/eclipse.jdt.core-Github_PR-2584/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java:[1997] 
01:15:12  [ERROR] 	IAnnotationBinding[] annotations = ctorBinding.getAnnotations();
01:15:12  [ERROR] 	^^^^^^^^^^^^^^^^^^

@stephan-herrmann
Copy link
Contributor

quick analysis:

  • org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(BlockScope, Annotation[], Binding, boolean) may return an array containing null (for unresolvable annotation)
  • compiler tests like org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest.testIssue2400() have no problem with this
  • ergo it's probably org.eclipse.jdt.core.dom.MethodBinding.filterTypeAnnotations(AnnotationBinding[]) that should be made aware of nulls.

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.

3 participants