🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7625

Re: ClassCastException

#7625
From: ct
Date: Thu, 14 Jun 2001 14:58
30 lines
1873 bytes
"Michael Rachow" <michael@famrachow.de> wrote:
>It had become a little bit of a puzzle meanwhile.
>
>So the problem is the (String) content of handlerName.

hanlderName = "packagename.SigninHandler";

>Since no ClassNotFound Exception is thrown,
>it must be StateHandlerSupport.
>You cannot downcast to a more specialized class,

No downcast occurs here.
The class hierarchy is as following,

StateHandker<--StateHandlerSupport<--SigninHandler
I am casting SigninHandler to StateHandker.

>if the instance is of a type above (more general) in the hierarchy "only".
>
>Your cast in printing is right but the cast at the assignment is the
>"special".

If we can explain why add a print statement will make exception
disappear, we maybe up to something.  My instince tell me that
there maybe a jar conflict somewhere.  But so far, I failed to
proof that.  Event so, it is still hard to explain that adding
a print statement will make difference.

ct
Technical Details
Message-ID: <3b28d102$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3b214690$1_1@dnews> <3b2345b6$1_1@dnews> <3b24c313$1_1@dnews> <3b266e7e_2@dnews> <3b268680$1_2@dnews> <3b27ddf4$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,8a0377b4254bc1e1
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-14 08:13:05 PST
From: "ct" <cctang@yahoo.com>
Sender: "ct" <cctang@yahoo.com>
Reply-To: "ct" <cctang@yahoo.com>
Subject: Re: ClassCastException
Newsgroups: borland.public.jbuilder.java.language
X-User-Info: 206.30.165.9 206.30.165.9    
References: <3b214690$1_1@dnews>  <3b2345b6$1_1@dnews>  <3b24c313$1_1@dnews>  <3b266e7e_2@dnews>  <3b268680$1_2@dnews>  <3b27ddf4$1_1@dnews> 
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3b28d102$1_1@dnews>
Date: 14 Jun 2001 07:58:10 -0700
X-Trace: dnews 992530690 207.105.83.65 (14 Jun 2001 07:58:10 -0700)
Lines: 30
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews