[jira] [Resolved] (GROOVY-9758) groovsh import of non existing class throws null pointer instead of syntax error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (GROOVY-9758) groovsh import of non existing class throws null pointer instead of syntax error

Eric Milles (Jira)

     [ https://issues.apache.org/jira/browse/GROOVY-9758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King resolved GROOVY-9758.
-------------------------------
    Fix Version/s: 4.0.0-alpha-2
                   3.0.7
                   2.5.14
         Assignee: Paul King
       Resolution: Fixed

I went ahead and fixed as per your suggestion. Thanks!

> groovsh import of non existing class throws null pointer instead of syntax error
> --------------------------------------------------------------------------------
>
>                 Key: GROOVY-9758
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9758
>             Project: Groovy
>          Issue Type: Bug
>          Components: Groovysh
>    Affects Versions: 3.0.3, 2.5.12
>            Reporter: Mykola Golubyev
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 2.5.14, 3.0.7, 4.0.0-alpha-2
>
>
> in groovy sh, when you import class that doesn't exist, the error you see is NullPointer instead of class not found.
> I tracked the problem to ImportCommand class
>  
> {code:java}
> catch (CompilationFailedException e) {
>     def msg = "Invalid import definition: '${importSpec}'; reason: $e.message" // TODO: i18n
>     log.debug(msg, e)
>     fail(msg)
> }
> finally {
>     // Remove the class generated while testing the import syntax
>     classLoader.removeClassCacheEntry(type?.name) <-- null is passed to remove call inside
> }
>  
> {code}
> I don't know the process, but I wouldn't mind to create PR



--
This message was sent by Atlassian Jira
(v8.3.4#803005)