cashew-s-editor
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [CASHeW-s-Editor] The error in "RDFHandler.java"....


From: Andrew John Hughes
Subject: Re: [CASHeW-s-Editor] The error in "RDFHandler.java"....
Date: Sat, 23 Apr 2005 12:00:24 +0100

On Thu, 2005-04-21 at 15:54 +0100, Ravish Bhagdev wrote:
> Hi,
> 
> I don't know what the problem is but here is what I think:
> 
> When I updated my copy from CVS few minutes ago I had these files:
> 
> ===================
> RDFObject.java
> ===================
> public interface RDFObject 
>   extends Cloneable
> {
> 
>   /**
>    * Returns a deep copy of the object.
>    *
>    * @return a deep copy of the object.
>    */
>   RDFObject clone();
> 
> }
> =======================
> "Subject.java":
> =======================
> public interface Subject 
>   extends Cloneable
> {
> 
>   /**
>    * Returns a deep copy of the subject.
>    *
>    * @return a deep copy of the subject.
>    */
>   Subject clone();
> 
> }
> 
> ========================
> "RDFHandler.java"
> =======================
> 
> only the statement with the error in this file is:
> object = (RDFObject) subject;
> 
> So, this is a cast from interface variable of type Subject to RDFObject.
> RDFObject is not subclass of Subject.  The error that Eclipse shows to me
> is: "Cannot cast from Subject to RDFObject".  I have no other errors in
> the entire project except this one.  So, I don't think it is 1.4/1.5
> problem.  I will try on another machine, although, I have tried creating
> a clean new project from the CVS and face the same problem.  For now, I
> just comment that line to run my copy and update it before doing commit.
> 
> Regards,
> Ravish Bhagdev.
> _______________________________________________
> CASHeW-s-editor mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/cashew-s-editor
> 

Try making the cast to Node rather than RDFObject.  Both work here, and
it seems your compiler is being very pedantic about an explicit cast
which works at runtime because the code block shouldn't be entered with
something that won't obey this cast.
-- 
Andrew :-)

Please avoid sending me Microsoft Office (e.g. Word, PowerPoint)
attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

No software patents in Europe -- http://nosoftwarepatents.com

"Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn."
-- Richard Stallman

Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]