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)
  • groovy
  • GROOVY-2117

GroovyBuilder causes an NPE on non-Groovy projects

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.1-rc-3
  • Component/s: None
  • Labels:
    None

Description

If a builder doesn't define an associate nature via hasNature in the extension point, all defined builders run. Since the GroovyProject returned in such a case is null, the NPE is expected.
We can either add the hasNature tag to the builder extension pt or deal with the null project. I opt for the former.

java.lang.NullPointerException
at org.codehaus.groovy.eclipse.core.builder.GroovyBuilder.build(GroovyBuilder.java:54)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:624)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:166)

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    groovy2117.txt
    08/Oct/07 10:16 AM
    2 kB
    Michael Fraenkel

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Michael Fraenkel added a comment - 13/Sep/07 5:56 AM

Seems that when I fixed 2118, I cannot reproduce this problem. I will keep on the look out for the cause of why this might occur.

Show
Michael Fraenkel added a comment - 13/Sep/07 5:56 AM Seems that when I fixed 2118, I cannot reproduce this problem. I will keep on the look out for the cause of why this might occur.
Hide
Permalink
Michael Fraenkel added a comment - 01/Oct/07 8:02 AM

The problem still exists and is easy to recreate as well as solve.

Create a Groovy project. Remove the groovy nature in the .project.
The groovyBuilder is present and will always attempt to run.

The solution is either to check if the project is a Groovy project, or just associate the groovyBuilder with the groovyNature as part of the extension point.

Show
Michael Fraenkel added a comment - 01/Oct/07 8:02 AM The problem still exists and is easy to recreate as well as solve. Create a Groovy project. Remove the groovy nature in the .project. The groovyBuilder is present and will always attempt to run. The solution is either to check if the project is a Groovy project, or just associate the groovyBuilder with the groovyNature as part of the extension point.
Hide
Permalink
Aaron Digulla added a comment - 05/Oct/07 10:58 AM

In my case, the project has a groovyNature and a groovyBuilder in the .project file but sometimes, it seems that Eclipse forgets about the nature. Starting Eclipse with -clean solves the issue for a while.

Maybe a classpath issue or an interference with another plugin?

Show
Aaron Digulla added a comment - 05/Oct/07 10:58 AM In my case, the project has a groovyNature and a groovyBuilder in the .project file but sometimes, it seems that Eclipse forgets about the nature. Starting Eclipse with -clean solves the issue for a while. Maybe a classpath issue or an interference with another plugin?
Hide
Permalink
Michael Fraenkel added a comment - 08/Oct/07 10:16 AM

Only performs a groovy build if its a groovy project.

Show
Michael Fraenkel added a comment - 08/Oct/07 10:16 AM Only performs a groovy build if its a groovy project.
Hide
Permalink
Aaron Digulla added a comment - 10/Oct/07 10:58 AM

I beg your pardon?

Show
Aaron Digulla added a comment - 10/Oct/07 10:58 AM I beg your pardon?
Hide
Permalink
Michael Fraenkel added a comment - 05/Nov/07 8:12 AM

A project without the Groovy Nature is no longer built.

Show
Michael Fraenkel added a comment - 05/Nov/07 8:12 AM A project without the Groovy Nature is no longer built.

People

  • Assignee:
    Michael Fraenkel
    Reporter:
    Michael Fraenkel
Vote (0)
Watch (0)

Dates

  • Created:
    12/Sep/07 8:51 PM
    Updated:
    21/Dec/09 6:49 AM
    Resolved:
    05/Nov/07 8:12 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.