groovy/groovy-eclipse — pull request #76 by DenisMurashev (2014-07-25 05:14:39+00:00)
Title: GRECLIPSE-1765 Fix to prevent NPE

NPE occured in org.codehaus.groovy.control.CompilationUnit.classgen.new PrimaryClassNodeOperation() {...}.call(SourceUnit, GeneratorContext, ClassNode) method.
That method is called with null source value from org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(PrimaryClassNodeOperation).

In applyToPrimaryClassNodes() method there are iterations over primary class nodes. Some of them can be generated with names like 'Expression$83107cf3$af3b$4037$95e7$0e113106d0af' and without sources.

Those sourceless classes are generated by org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.evaluateExpression(Expression, CompilerConfiguration).

A few lines above the line where NPE occurred the source value is checked for null, and this checking comes from unpatched CompilationUnit class.

So I think it is normal for 'source' parameter to be null and these null sources should not prevent class generation in PrimaryClassNodeOperation.