jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
GRECLIPSE
  • GRECLIPSE
  • GRECLIPSE-1038

NPE in Groovy compiler

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.1.2Release
  • Fix Version/s: 2.5.2.Release
  • Component/s: Compiler Integration
  • Labels:
    None
  • Environment:
    Linux, Groovy 1.7 compiler in Greclipse
  • Number of attachments :
    0

Description

This code in the Groovy editor

// this is a DSLD file
// start off creating a custom DSL Descriptor for your Groovy DSL

// The following snippet adds the 'newProp' property to all GroovyObjects
currentType('groovy.lang.GroovyObject').accept {
  property name : 'newProp', type : String, provider : 'Sample DSL', doc : 'This is a sample.  You should see this in content assist for GroovyObjects: <pre>newProp</pre>'
}

currentType('java.lang.String').accept {
	method 
		name:'reverberate', 
		type:'Froogle', params:params, useNamedArgs:useNamedArgs, isStatic:isStatic, declaringType:'java.lang.String', provider:'kris', doc:'reverse a String'
}

Causes NPE

eclipse.buildId=unknown
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_CA
Framework arguments:  -product com.springsource.sts.ide
Command-line arguments:  -product com.springsource.sts.ide -data /home/kdvolder/workspaces-sts/tc-dragdrop-runtime -dev file:/home/kdvolder/workspaces-sts/sts-grails/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os linux -ws gtk -arch x86 -consoleLog


Error
Mon Apr 18 10:43:24 PDT 2011
Groovy bug when compiling.

BUG! exception in phase 'conversion' in source unit '/playDsl/src/kris-dsl.dsld' null
	at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:957)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:579)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:555)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:532)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:168)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.dietParse(GroovyParser.java:429)
	at org.codehaus.jdt.groovy.integration.internal.MultiplexingSourceElementRequestorParser.parseCompilationUnit(MultiplexingSourceElementRequestorParser.java:73)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:194)
	at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.buildStructure(GroovyCompilationUnit.java:325)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)
	at org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:1096)
	at org.codehaus.jdt.groovy.model.GroovyReconcileWorkingCopyOperation.makeConsistent(GroovyReconcileWorkingCopyOperation.java:60)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
	at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.reconcile(GroovyCompilationUnit.java:410)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1215)
	at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.getModuleNode(GroovyCompilationUnit.java:112)
	at org.codehaus.groovy.eclipse.editor.outline.OCompilationUnit.getNode(OCompilationUnit.java:79)
	at org.codehaus.groovy.eclipse.editor.outline.GroovyScriptOCompilationUnit.refreshChildren(GroovyScriptOutlineExtender.java:76)
	at org.codehaus.groovy.eclipse.editor.outline.OCompilationUnit.refresh(OCompilationUnit.java:86)
	at org.codehaus.groovy.eclipse.editor.outline.GroovyOutlinePage.refresh(GroovyOutlinePage.java:49)
	at org.codehaus.groovy.eclipse.editor.GroovyEditor.synchronizeOutlinePage(GroovyEditor.java:1320)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.synchronizeOutlinePage(JavaEditor.java:2121)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.selectionChanged(JavaEditor.java:2239)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$EditorSelectionChangedListener.selectionChanged(JavaEditor.java:300)
	at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2745)
	at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2693)
	at org.eclipse.jface.text.TextViewer$5.run(TextViewer.java:2672)
	at org.eclipse.swt.widgets.Display.timerProc(Display.java:4106)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2237)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Caused by: java.lang.NullPointerException
	at org.codehaus.groovy.antlr.AntlrParserPlugin.statement(AntlrParserPlugin.java:1305)
	at org.codehaus.groovy.antlr.AntlrParserPlugin.labelledStatement(AntlrParserPlugin.java:1517)
	at org.codehaus.groovy.antlr.AntlrParserPlugin.statement(AntlrParserPlugin.java:1322)
	at org.codehaus.groovy.antlr.AntlrParserPlugin.convertGroovy(AntlrParserPlugin.java:332)
	at org.codehaus.groovy.antlr.AntlrParserPlugin.buildAST(AntlrParserPlugin.java:238)
	at org.codehaus.groovy.control.SourceUnit.convert(SourceUnit.java:298)
	at org.codehaus.groovy.control.CompilationUnit$3.call(CompilationUnit.java:702)
	at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:948)
	... 54 more


Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Andrew Eisenberg added a comment - 17/Aug/11 6:27 PM

This code is syntactically incorrect. The newline after 'method' breaks things. All we can do is recover gracefully.

I added a null check and things appear to be behaving. Fix is added for 1.7 and 1.8 streams.

Show
Andrew Eisenberg added a comment - 17/Aug/11 6:27 PM This code is syntactically incorrect. The newline after 'method' breaks things. All we can do is recover gracefully. I added a null check and things appear to be behaving. Fix is added for 1.7 and 1.8 streams.

People

  • Assignee:
    Andrew Eisenberg
    Reporter:
    Kris De Volder
Vote (0)
Watch (0)

Dates

  • Created:
    18/Apr/11 12:47 PM
    Updated:
    17/Aug/11 6:27 PM
    Resolved:
    17/Aug/11 6:27 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.