Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.8.0.Release
-
Component/s: Compiler Integration
-
Labels:None
-
Environment:Version 2.5.2.xx-20111007-1500-e36
-
Number of attachments :
Description
If I have a Java class called "org.acme.Foo", then the script file named "org/acme/Foo/xyz.groovy" loses DSLD content assist support.
Looking at the Groovy event console, I see a NullPointerException as below.
The problem appears to be related to the fact that the directory name collides with another Java class, as Groovy files placed elsewhere do not get this problem. Note however that this xyz.groovy file doesn't have a package declaration.
See GRECLIPSE-1076 for a package/class conflict related issue that may or may not be related.
java.lang.NullPointerException at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.recordDependency(JDTResolver.java:316) at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.resolveFromCompileUnit(JDTResolver.java:155) at org.codehaus.groovy.control.ResolveVisitor.resolveNestedClass(ResolveVisitor.java:331) at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:304) at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.resolve(JDTResolver.java:292) at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:261) at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.resolve(JDTResolver.java:303) at org.codehaus.groovy.eclipse.dsl.lookup.ResolverCache.resolve(ResolverCache.java:62) at org.codehaus.groovy.eclipse.dsl.contributions.DSLContributionGroup.delegatesTo(DSLContributionGroup.java:249) at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:362) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149) at eclipse$_run_closure1.doCall(eclipse.dsld:8) at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149) at eclipse$_run_closure1.doCall(eclipse.dsld) at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886) at groovy.lang.Closure.call(Closure.java:282) at groovy.lang.Closure.call(Closure.java:277) at org.codehaus.groovy.eclipse.dsl.contributions.DSLContributionGroup.getContributions(DSLContributionGroup.java:102) at org.codehaus.groovy.eclipse.dsl.DSLDStore.findContributions(DSLDStore.java:132) at org.codehaus.groovy.eclipse.dsl.lookup.DSLDTypeLookup.lookupTypeAndDeclaration(DSLDTypeLookup.java:58) at org.eclipse.jdt.groovy.search.AbstractSimplifiedTypeLookup.lookupType(AbstractSimplifiedTypeLookup.java:81) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.handleExpression(TypeInferencingVisitorWithRequestor.java:763) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitConstantExpression(TypeInferencingVisitorWithRequestor.java:1321) at org.codehaus.groovy.ast.expr.ConstantExpression.visit(ConstantExpression.java:55) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1406) at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:75) at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:69) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:209) at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:179) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitBlockStatement(TypeInferencingVisitorWithRequestor.java:1252) at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) at org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:174) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitClosureExpression(TypeInferencingVisitorWithRequestor.java:1085) at org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:45) at org.codehaus.groovy.ast.CodeVisitorSupport.visitListOfExpressions(CodeVisitorSupport.java:280) at org.codehaus.groovy.ast.CodeVisitorSupport.visitTupleExpression(CodeVisitorSupport.java:178) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitTupleExpression(TypeInferencingVisitorWithRequestor.java:1620) at org.codehaus.groovy.ast.CodeVisitorSupport.visitArgumentlistExpression(CodeVisitorSupport.java:290) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitArgumentlistExpression(TypeInferencingVisitorWithRequestor.java:907) at org.codehaus.groovy.ast.expr.ArgumentListExpression.visit(ArgumentListExpression.java:73) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1426) at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:75) at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:69) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:209) at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:179) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitBlockStatement(TypeInferencingVisitorWithRequestor.java:1252) at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:102) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:113) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitConstructorOrMethod(TypeInferencingVisitorWithRequestor.java:646) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitJDT(TypeInferencingVisitorWithRequestor.java:390) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitJDT(TypeInferencingVisitorWithRequestor.java:236) at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitCompilationUnit(TypeInferencingVisitorWithRequestor.java:191) at org.codehaus.groovy.eclipse.editor.highlighting.GatherSemanticReferences.findSemanticHighlightingReferences(GatherSemanticReferences.java:52) at org.codehaus.groovy.eclipse.editor.highlighting.GroovySemanticReconciler.reconciled(GroovySemanticReconciler.java:149) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.reconciled(CompilationUnitEditor.java:1632) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconciled(JavaReconcilingStrategy.java:212) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconciled(JavaCompositeReconcilingStrategy.java:161) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:110) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
Activity
Andrew Eisenberg
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Component/s | Compiler Integration [ 14686 ] | |
| Component/s | DSL Support [ 14688 ] |
Andy Clement
made changes -
| Assignee | Andy Clement [ aclement ] |
Andrew Eisenberg
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 2.8.0.Release [ 18618 ] | |
| Resolution | Fixed [ 1 ] |
As a work around, can you try right clicking on the script -> Build Path -> Exclude? Does that at least prevent the NPEs from happening?