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

Indexing fails when config script adds static import of field or method #1074

Closed
eric-milles opened this issue Mar 31, 2020 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Mar 31, 2020

Consider the following:

config.groovy

withConfig(configuration) {
  imports {
    staticMember 'java.util.concurrent.TimeUnit', 'SECONDS'
  }
}

script.groovy

println 'hello world'

When editing the Groovy script in a project with the config enhancements, the following is logged:

java.lang.NullPointerException
	at org.codehaus.jdt.groovy.integration.internal.GroovyIndexingVisitor.visitImport(GroovyIndexingVisitor.java:71)
	at org.eclipse.jdt.groovy.core.util.DepthFirstVisitor.visitModule(DepthFirstVisitor.java:123)
	at org.codehaus.jdt.groovy.integration.internal.MultiplexingIndexingParser.lambda$0(MultiplexingIndexingParser.java:73)
	at java.base/java.util.Optional.ifPresent(Optional.java:183)
	at org.codehaus.jdt.groovy.integration.internal.MultiplexingIndexingParser.parseCompilationUnit(MultiplexingIndexingParser.java:71)
	at org.eclipse.jdt.internal.core.search.indexing.SourceIndexer.indexDocument(SourceIndexer.java:115)
	at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:71)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:552)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager$1.execute(IndexManager.java:1082)
	at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:401)
	at java.base/java.lang.Thread.run(Thread.java:834)
@eric-milles eric-milles added this to the v3.8.0 milestone Mar 31, 2020
@eric-milles eric-milles self-assigned this Mar 31, 2020
eric-milles added a commit that referenced this issue Mar 31, 2020
- imported fields and methods already handled by visitConstantExpression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant