river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Brouwer (JIRA)" <j...@apache.org>
Subject [jira] Updated: (RIVER-282) Suspect exception cast
Date Sat, 02 Feb 2008 11:30:08 GMT

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

Mark Brouwer updated RIVER-282:
-------------------------------

    Description: 
FiddlerImpl does this 
-------------------
{code}
private void handleActivatableInitThrowable(Throwable t) 
                                            throws IOException,
                                                   ActivationException,
                                                   ConfigurationException,
                                                   LoginException,
                                                   ClassNotFoundException
    {
        handleInitThrowable(t);
        if (t instanceof ActivationException) {
            throw (ActivationException)t;
        } else if (t instanceof LoginException) {
            throw (ClassNotFoundException)t;
        } else {
            throw new AssertionError(t);
        }//endif
{code}
-----------------

the concerning part is
{code}
} else if (t instanceof LoginException) {
            throw (ClassNotFoundException)t;
{code}
if t is an instanceof LoginException, i don't think it can be cast to ClassNotFoundException.


   

  was:
FiddlerImpl does this 
-------------------
   private void handleActivatableInitThrowable(Throwable t) 
                                            throws IOException,
                                                   ActivationException,
                                                   ConfigurationException,
                                                   LoginException,
                                                   ClassNotFoundException
    {
        handleInitThrowable(t);
        if (t instanceof ActivationException) {
            throw (ActivationException)t;
        } else if (t instanceof LoginException) {
            throw (ClassNotFoundException)t;
        } else {
            throw new AssertionError(t);
        }//endif
-----------------

the concerning part is
} else if (t instanceof LoginException) {
            throw (ClassNotFoundException)t;

if t is an instanceof LoginException, i don't think it can be cast to ClassNotFoundException.


   


Thanks Dave that looks like a bug, a quick look gives me the impression that it should be
{{ClassNotFoundException}} that should be caught there as {{handleInitThrowable(Throwable
t)}} takes care of the {{LoginException}}. I also beautified your description to make it more
readable.

> Suspect exception cast
> ----------------------
>
>                 Key: RIVER-282
>                 URL: https://issues.apache.org/jira/browse/RIVER-282
>             Project: River
>          Issue Type: Bug
>          Components: com_sun_jini_fiddler
>         Environment: n/a
>            Reporter: Dave Brosius
>            Priority: Minor
>
> FiddlerImpl does this 
> -------------------
> {code}
> private void handleActivatableInitThrowable(Throwable t) 
>                                             throws IOException,
>                                                    ActivationException,
>                                                    ConfigurationException,
>                                                    LoginException,
>                                                    ClassNotFoundException
>     {
>         handleInitThrowable(t);
>         if (t instanceof ActivationException) {
>             throw (ActivationException)t;
>         } else if (t instanceof LoginException) {
>             throw (ClassNotFoundException)t;
>         } else {
>             throw new AssertionError(t);
>         }//endif
> {code}
> -----------------
> the concerning part is
> {code}
> } else if (t instanceof LoginException) {
>             throw (ClassNotFoundException)t;
> {code}
> if t is an instanceof LoginException, i don't think it can be cast to ClassNotFoundException.
>    

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


Mime
View raw message