[ 
https://issues.apache.org/jira/browse/UIMA-1478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740126#action_12740126
 ] 

Jörn Kottmann commented on UIMA-1478:
-------------------------------------

No you are right.The exception handling in the method should be improved. If 
the exceptions can really occur and the method cannot return a cas object it 
throws a NPE. I just tried to say that returning null does not help to improve 
the situation at all.
To improve the situation we have to find out if the exceptions can really be 
thrown and then we can replace
the NPE by another explicit exception which also contains a message.

The method should also have a short javadoc comment explaining what it does and 
maybe explain under which
circumstances it throws an exception.

Please feel free to refactor the method.

> possible NullPointerException on CASInitializer
> -----------------------------------------------
>
>                 Key: UIMA-1478
>                 URL: https://issues.apache.org/jira/browse/UIMA-1478
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>    Affects Versions: 2.2.2
>         Environment: MacOSX 10.5
>            Reporter: Tommaso Teofili
>             Fix For: 2.3S
>
>         Attachments: patch1478.txt
>
>
> code at lline 69
> return casMgr.getCAS().getCurrentView();
> could raise a not handled NPE on casMgr and getCAS()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to